Пример #1
0
 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'))
Пример #2
0
 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'))
Пример #3
0
 def test_get_config_error(self):
     lib.get_config(None, 'index:ckan')
Пример #4
0
 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/'
Пример #5
0
 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
Пример #6
0
 def test_get_config_error(self):
     lib.get_config(None, 'index:ckan')
Пример #7
0
 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/'