def test_uppercase_items_are_also_attributes(self): config = Config() config.DEBUG = True assert config['DEBUG'] config['PORT'] = 5000 assert config.PORT == 5000
def test_cant_set_uppercase_attribute_as_attribute(self): config = Config() config.DEBUG = True # seems like an attribute assert hasattr(config, 'DEBUG') # actually is not an attribute assert 'DEBUG' not in config.__dict__