summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_configparser.py
diff options
context:
space:
mode:
authorjsnklln <jsnklln@gmail.com>2021-07-13 13:54:06 (GMT)
committerGitHub <noreply@github.com>2021-07-13 13:54:06 (GMT)
commit2924bb1a566977efd45f335d6a94cd84d8047edf (patch)
tree872c80a03960e31e8629a5ea2861dcb92158e506 /Lib/test/test_configparser.py
parentd4a5f0b659a2b8f206cfbdfd37fc36aedf77a71f (diff)
downloadcpython-2924bb1a566977efd45f335d6a94cd84d8047edf.zip
cpython-2924bb1a566977efd45f335d6a94cd84d8047edf.tar.gz
cpython-2924bb1a566977efd45f335d6a94cd84d8047edf.tar.bz2
bpo-38741: Definition of multiple ']' in header configparser (GH-17129)
Co-authored-by: Jason Killen <jason.killen@windsorcircle.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Diffstat (limited to 'Lib/test/test_configparser.py')
-rw-r--r--Lib/test/test_configparser.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py
index 9373a62..e9b03e6 100644
--- a/Lib/test/test_configparser.py
+++ b/Lib/test/test_configparser.py
@@ -79,6 +79,7 @@ class BasicTestCase(CfgParserTestCaseClass):
'Spacey Bar',
'Spacey Bar From The Beginning',
'Types',
+ 'This One Has A ] In It',
]
if self.allow_no_value:
@@ -130,6 +131,7 @@ class BasicTestCase(CfgParserTestCaseClass):
eq(cf.get('Types', 'float'), "0.44")
eq(cf.getboolean('Types', 'boolean'), False)
eq(cf.get('Types', '123'), 'strange but acceptable')
+ eq(cf.get('This One Has A ] In It', 'forks'), 'spoons')
if self.allow_no_value:
eq(cf.get('NoValue', 'option-without-value'), None)
@@ -320,6 +322,8 @@ int {0[1]} 42
float {0[0]} 0.44
boolean {0[0]} NO
123 {0[1]} strange but acceptable
+[This One Has A ] In It]
+ forks {0[0]} spoons
""".format(self.delimiters, self.comment_prefixes)
if self.allow_no_value:
config_string += (
@@ -394,6 +398,9 @@ boolean {0[0]} NO
"boolean": False,
123: "strange but acceptable",
},
+ "This One Has A ] In It": {
+ "forks": "spoons"
+ },
}
if self.allow_no_value:
config.update({