summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_configparser.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_configparser.py')
-rw-r--r--Lib/test/test_configparser.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py
index e3c5d08..bde805e 100644
--- a/Lib/test/test_configparser.py
+++ b/Lib/test/test_configparser.py
@@ -2174,6 +2174,15 @@ class SectionlessTestCase(unittest.TestCase):
with self.assertRaises(configparser.UnnamedSectionDisabledError):
configparser.ConfigParser().add_section(configparser.UNNAMED_SECTION)
+ def test_multiple_configs(self):
+ cfg = configparser.ConfigParser(allow_unnamed_section=True)
+ cfg.read_string('a = 1')
+ cfg.read_string('b = 2')
+
+ self.assertEqual([configparser.UNNAMED_SECTION], cfg.sections())
+ self.assertEqual('1', cfg[configparser.UNNAMED_SECTION]['a'])
+ self.assertEqual('2', cfg[configparser.UNNAMED_SECTION]['b'])
+
class MiscTestCase(unittest.TestCase):
def test__all__(self):