Exemple #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
Exemple #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
Exemple #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__
Exemple #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__