(self)
| 59 | _box_defaults = {"defualt_box": True} |
| 60 | |
| 61 | def test_no_init_override_needed(self): |
| 62 | # The pattern people tried in #296 / #223 fails, this is the replacement |
| 63 | class MyConfig(Box): |
| 64 | _box_defaults = {"default_box": True, "box_dots": True} |
| 65 | |
| 66 | config = MyConfig() |
| 67 | config["server.host"] = "localhost" |
| 68 | assert config.to_dict() == {"server": {"host": "localhost"}} |
| 69 | |
| 70 | def test_copy_pickle_and_conversions_keep_defaults(self): |
| 71 | b = DefaultBox({"a": {"b": 1}}) |