def test_configdict_setattr(self): config = ConfigDict() config.test = "value" assert config["test"] == "value", "Incorrect attribute value" config.test = "updated" assert config["test"] != "value", "Incorrect attribute value" config["test"] = "new value" assert config["test"] == "new value", "Incorrect attribute value"
def test_configdict_getattr(self): config = ConfigDict() # verify attribute doesn't already exist raises(AttributeError, lambda: getattr(config, "test")) config["test"] = "value" assert config["test"] == "value", "Incorrect attribute value" assert config.test == "value", "Incorrect attribute value" config.test = "updated" assert config["test"] != "value", "Incorrect attribute value" assert config.test != "value", "Incorrect attribute value" assert config["test"] == "updated", "Incorrect attribute value" assert config.test == "updated", "Incorrect attribute value" assert getattr(config, "test") == "updated", "Incorrect attribute value"