示例#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
文件: test_lib.py 项目: iRail/dpm
 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/'