def test_load_from_either_mapping_or_object(self): config1 = Config() config1.load({'DEBUG': True}) assert config1.DEBUG config2 = Config() config2.load(AppConfig) assert config2.SECRET_KEY == '123***456'
def test_load_from_either_mapping_or_object(self): config1 = Config() config1.load({'DEBUG': True}) assert config1.DEBUG config2 = Config() config2.load(AppConfig) assert config2.SECRET_KEY == '123***456'
from __future__ import absolute_import from easyconfig import Config, str_object from . import default config = Config(default) # Override the default configuration if `RESTART_CONFIG_MODULE` is given config.load(str_object('RESTART_CONFIG_MODULE', silent=True, is_envvar=True))