From 34f6f5f3f835a14b85b6f1bc86a56aa5c227c358 Mon Sep 17 00:00:00 2001 From: cclecle Date: Sat, 1 Apr 2023 00:57:59 +0100 Subject: [PATCH] fix unit test using section[0] (no more single value if only one result) --- test/test_simpleini.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test_simpleini.py b/test/test_simpleini.py index e88b2a4..bd32443 100644 --- a/test/test_simpleini.py +++ b/test/test_simpleini.py @@ -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")