Ejemplo n.º 1
0
 def test_load_from_none_object(self):
     config = Config()
     config.from_object(None)
     uppercase_attrs = [attr for attr in dir(config) if attr.isupper()]
     assert not uppercase_attrs
Ejemplo n.º 2
0
 def test_load_from_object(self):
     config = Config()
     config.from_object(AppConfig)
     assert config.SECRET_KEY == '123***456'
Ejemplo n.º 3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from easyconfig import Config, envvar_object

from . import default_settings

settings = Config()
settings.from_object(default_settings)

# Override default settings if `RESOURCE_SETTINGS_MODULE` is given
settings.from_object(envvar_object('RESOURCE_SETTINGS_MODULE', True))
Ejemplo n.º 4
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from easyconfig import Config, envvar_object

from . import default_settings


settings = Config()
settings.from_object(default_settings)

# Override default settings if `RESOURCE_SETTINGS_MODULE` is given
settings.from_object(envvar_object('RESOURCE_SETTINGS_MODULE', True))
Ejemplo n.º 5
0
 def test_load_from_none_object(self):
     config = Config()
     config.from_object(None)
     uppercase_attrs = [attr for attr in dir(config) if attr.isupper()]
     assert not uppercase_attrs
Ejemplo n.º 6
0
 def test_load_from_object(self):
     config = Config()
     config.from_object(AppConfig)
     assert config.SECRET_KEY == '123***456'