Пример #1
0
 def merging_does_not_wipe_user_modifications_or_deletions(self):
     c = Config({"foo": {"bar": "biz"}, "error": True})
     c.foo.bar = "notbiz"
     del c["error"]
     assert c["foo"]["bar"] == "notbiz"
     assert "error" not in c
     c.merge()
     # Will be back to 'biz' if user changes don't get saved on their
     # own (previously they are just mutations on the cached central
     # config)
     assert c["foo"]["bar"] == "notbiz"
     # And this would still be here, too
     assert "error" not in c
Пример #2
0
 def overrides_can_skip_merging(self):
     c = Config()
     c.load_overrides({"foo": "bar"}, merge=False)
     assert "foo" not in c
     c.merge()
     assert c.foo == "bar"
Пример #3
0
 def defaults_can_skip_merging(self):
     c = Config()
     c.load_defaults({"foo": "bar"}, merge=False)
     assert "foo" not in c
     c.merge()
     assert c.foo == "bar"