def test_set_config(self): value = lib.set_config("test:section", "test.option", "testvalue") assert value == "testvalue" assert lib.get_config("test:section") == ["test.option"] #clean up dpm.CONFIG.remove_section("test:section") dpm.CONFIG.write(open(dpm.config.default_config_path, 'w'))
def test_set_config(self): value = lib.set_config("test:section", "test.option", "testvalue") assert value == "testvalue" assert lib.get_config("test:section") == ["test.option"] #clean up dpm.CONFIG.remove_section("test:section") dpm.CONFIG.write(open(dpm.config.default_config_path,'w'))
def test_get_config_error(self): lib.get_config(None, 'index:ckan')
def test_get_config(self): assert lib.get_config() == dpm.CONFIG.sections() assert dpm.CONFIG.options('index:ckan') == lib.get_config(section="index:ckan") assert dpm.lib.get_config('index:ckan','ckan.url') == 'http://thedatahub.org/api/'
def test_config(self): cfg_lib = lib.get_config() cfg_dpm = dpm.CONFIG assert cfg_lib == cfg_dpm # dpm.CONFIG is already tested in test_config.py
def test_get_config(self): assert lib.get_config() == dpm.CONFIG.sections() assert dpm.CONFIG.options('index:ckan') == lib.get_config( section="index:ckan") assert dpm.lib.get_config('index:ckan', 'ckan.url') == 'http://thedatahub.org/api/'