fix unit test using section[0] (no more single value if only one result)
This commit is contained in:
@@ -115,7 +115,7 @@ class Test_PySimpleINI_base(unittest.TestCase):
|
||||
# remove an item
|
||||
testinitmp = PySimpleINI(testdir_path / "tmp/out.ini")
|
||||
section = testinitmp.getsection("testsection2")
|
||||
section.delkey("key1")
|
||||
section[0].delkey("key1")
|
||||
testinitmp.writefile(True)
|
||||
# verify
|
||||
testinitmp = PySimpleINI(testdir_path / "tmp/out.ini")
|
||||
@@ -125,7 +125,7 @@ class Test_PySimpleINI_base(unittest.TestCase):
|
||||
# remove an item
|
||||
testinitmp = PySimpleINI(testdir_path / "tmp/out.ini")
|
||||
section = testinitmp.getsection("testsection2")
|
||||
section.delkey("key2", 2)
|
||||
section[0].delkey("key2", 2)
|
||||
testinitmp.writefile(True)
|
||||
# verify
|
||||
testinitmp = PySimpleINI(testdir_path / "tmp/out.ini")
|
||||
@@ -134,7 +134,7 @@ class Test_PySimpleINI_base(unittest.TestCase):
|
||||
# remove an item
|
||||
testinitmp = PySimpleINI(testdir_path / "tmp/out.ini")
|
||||
section = testinitmp.getsection("testsection2")
|
||||
section.delkey("key2", None, "test3")
|
||||
section[0].delkey("key2", None, "test3")
|
||||
testinitmp.writefile(True)
|
||||
# verify
|
||||
testinitmp = PySimpleINI(testdir_path / "tmp/out.ini")
|
||||
@@ -144,12 +144,12 @@ class Test_PySimpleINI_base(unittest.TestCase):
|
||||
testinitmp = PySimpleINI(testdir_path / "tmp/out.ini")
|
||||
section = testinitmp.getsection("testsection1")
|
||||
with self.assertRaises(KeyNotFoundError):
|
||||
section.delkey("key2", 1, "test2")
|
||||
section[0].delkey("key2", 1, "test2")
|
||||
|
||||
# remove an item
|
||||
testinitmp = PySimpleINI(testdir_path / "tmp/out.ini")
|
||||
section = testinitmp.getsection("testsection1")
|
||||
section.delkey("key2", 1, "test3")
|
||||
section[0].delkey("key2", 1, "test3")
|
||||
testinitmp.writefile(True)
|
||||
# verify
|
||||
testinitmp = PySimpleINI(testdir_path / "tmp/out.ini")
|
||||
|
||||
Reference in New Issue
Block a user