示例#1
0
    def test_uppercase_items_are_also_attributes(self):
        config = Config()
        config.DEBUG = True
        assert config['DEBUG']

        config['PORT'] = 5000
        assert config.PORT == 5000
示例#2
0
    def test_uppercase_items_are_also_attributes(self):
        config = Config()
        config.DEBUG = True
        assert config['DEBUG']

        config['PORT'] = 5000
        assert config.PORT == 5000
示例#3
0
 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__
示例#4
0
 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__