mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-01-06 08:40:21 +01:00
edit test_config for better coverage
This commit is contained in:
parent
03e2f6091e
commit
9c38eeaac0
|
|
@ -3,4 +3,10 @@ one = 1
|
|||
two = two
|
||||
|
||||
[testcase]
|
||||
test = ok
|
||||
test = ok
|
||||
|
||||
[boolTest]
|
||||
one = 1
|
||||
two = True
|
||||
three = 0
|
||||
four = False
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue