edit test_config for better coverage

This commit is contained in:
Bastian Schroll 2018-01-12 19:39:11 +01:00
parent 03e2f6091e
commit 9c38eeaac0
2 changed files with 23 additions and 2 deletions

View file

@ -3,4 +3,10 @@ one = 1
two = two
[testcase]
test = ok
test = ok
[boolTest]
one = 1
two = True
three = 0
four = False

View file

@ -59,7 +59,6 @@ class Test_Config:
bwConfig1 = Config()
bwConfig1.loadConfigFile(paths.TEST_PATH + "test.ini", "test_shareConfigUsed")
assert bwConfig1._sharePoints["test_shareConfigUsed"] is not None
bwConfig2 = Config()
bwConfig2.loadConfigFile(paths.TEST_PATH + "test.ini")
assert not bwConfig2._shareConfig("test_shareConfigUsed")
@ -90,3 +89,19 @@ class Test_Config:
bwConfig2 = Config()
assert bwConfig2.getStr("test", "abc", "test_getSharedConfigFailed") == "None"
assert bwConfig2.getStr("abc", "test", "test_getSharedConfigFailed") == "None"
def test_getDataTypes(self):
bwConfig = Config()
bwConfig.loadConfigFile(paths.TEST_PATH + "test.ini")
assert bwConfig.getStr("testcase", "test") == "ok"
assert bwConfig.getInt("test", "one") == 1
assert bwConfig.getInt("boolTest", "three") == 0
assert bwConfig.getBool("boolTest", "one")
assert bwConfig.getBool("boolTest", "two")
assert not bwConfig.getBool("boolTest", "three")
assert not bwConfig.getBool("boolTest", "four")
def test_getAllSharepoints(self):
bwConfig = Config()
bwConfig.loadConfigFile(paths.TEST_PATH + "test.ini", "test_shareConfig")
assert bwConfig.getAllSharepoints() is not None