mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
SF bug #1017864: ConfigParser now correctly handles default keys, processing them with `ConfigParser.optionxform
` when supplied, consistent with the handling of config file entries and runtime-set options.
This commit is contained in:
parent
bfe5684308
commit
68a1abdade
3 changed files with 24 additions and 7 deletions
|
@ -115,6 +115,16 @@ class TestCaseBase(unittest.TestCase):
|
|||
self.failUnless(cf.has_option("section", "Key"))
|
||||
|
||||
|
||||
def test_default_case_sensitivity(self):
|
||||
cf = self.newconfig({"foo": "Bar"})
|
||||
self.assertEqual(
|
||||
cf.get("DEFAULT", "Foo"), "Bar",
|
||||
"could not locate option, expecting case-insensitive option names")
|
||||
cf = self.newconfig({"Foo": "Bar"})
|
||||
self.assertEqual(
|
||||
cf.get("DEFAULT", "Foo"), "Bar",
|
||||
"could not locate option, expecting case-insensitive defaults")
|
||||
|
||||
def test_parse_errors(self):
|
||||
self.newconfig()
|
||||
self.parse_error(ConfigParser.ParsingError,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue