def test_extend_with_default_external_config_all(default_config, default_config_file_system): assert default_config.int_val == -1 assert default_config.str_val == 'value-1' extend_with_default_external_config(default_config) assert default_config.int_val == 3 assert default_config.str_val == 'value3'
def test_extend_with_default_external_config_gen_net(default_config, default_config_file_system): gen_base_dir = os.path.join(default_config.baseDir, default_config.NETWORK_NAME) usr_cfg_file = os.path.join(gen_base_dir, default_config.USER_CONFIG_FILE) os.remove(usr_cfg_file) assert default_config.int_val == -1 assert default_config.str_val == 'value-1' extend_with_default_external_config(default_config) assert default_config.int_val == 2 assert default_config.str_val == 'value2'
def test_extend_with_default_external_config_gen_net(default_config, default_config_file_system): gen_base_dir = os.path.join(default_config.baseDir, default_config.NETWORK_NAME) usr_cfg_file = os.path.join(gen_base_dir, default_config.USER_CONFIG_FILE) os.remove(usr_cfg_file) assert default_config.int_val == -1 assert default_config.str_val == 'value-1' extend_with_default_external_config(default_config) assert default_config.int_val == 2 assert default_config.str_val == 'value2'
def _getConfig(plenum_config_func, general_config_dir=None, user_config_dir=None): config = plenum_config_func(general_config_dir) indyConfig = import_module("indy_common.config") config.__dict__.update(indyConfig.__dict__) extend_with_default_external_config(config, general_config_dir=general_config_dir, user_config_dir=user_config_dir) return config
def _getConfig(plenum_config_func, general_config_dir=None, user_config_dir=None): config = plenum_config_func(general_config_dir) indyConfig = import_module("indy_common.config") config.__dict__.update(indyConfig.__dict__) extend_with_default_external_config(config, general_config_dir=general_config_dir, user_config_dir=user_config_dir) return config
def getConfig(user_config_dir=None): global CONFIG if not CONFIG: config = PlenumConfig(user_config_dir) indyConfig = import_module("indy_common.config") config.__dict__.update(indyConfig.__dict__) extend_with_default_external_config(config, user_config_dir) CONFIG = config return CONFIG
def _getConfig(plenum_config_func, general_config_dir=None, user_config_dir=None, ignore_external_config_update_errors=False): config = plenum_config_func(general_config_dir) indyConfig = import_module("indy_common.config") config.__dict__.update(indyConfig.__dict__) try: extend_with_default_external_config(config, general_config_dir=general_config_dir, user_config_dir=user_config_dir) except Exception as ex: if not ignore_external_config_update_errors: raise ex return config
def _getConfig(plenum_config_func, general_config_dir=None, user_config_dir=None, ignore_external_config_update_errors=False): config = plenum_config_func(general_config_dir) indyConfig = import_module("indy_common.config") config.__dict__.update(indyConfig.__dict__) try: extend_with_default_external_config( config, general_config_dir=general_config_dir, user_config_dir=user_config_dir) except Exception as ex: if not ignore_external_config_update_errors: raise ex return config
def test_extend_with_default_external_config_all(default_config, default_config_file_system): assert default_config.int_val == -1 assert default_config.str_val == 'value-1' extend_with_default_external_config(default_config) assert default_config.int_val == 3 assert default_config.str_val == 'value3'