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:
David Goodger 2004-10-03 15:40:25 +00:00
parent bfe5684308
commit 68a1abdade
3 changed files with 24 additions and 7 deletions

View file

@ -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,