summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cfgparser.py
diff options
context:
space:
mode:
authorDavid Goodger <goodger@python.org>2004-10-03 15:40:25 (GMT)
committerDavid Goodger <goodger@python.org>2004-10-03 15:40:25 (GMT)
commit68a1abdadec2377fd3e8d2211cb3cc119de77a28 (patch)
tree93db094b5487a4e8999c894c3ce7ba950bea97a3 /Lib/test/test_cfgparser.py
parentbfe56843084c0ccb7f26e5225b1c22d767d90eb8 (diff)
downloadcpython-68a1abdadec2377fd3e8d2211cb3cc119de77a28.zip
cpython-68a1abdadec2377fd3e8d2211cb3cc119de77a28.tar.gz
cpython-68a1abdadec2377fd3e8d2211cb3cc119de77a28.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_cfgparser.py')
-rw-r--r--Lib/test/test_cfgparser.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_cfgparser.py b/Lib/test/test_cfgparser.py
index c799c7d..6b3e68a 100644
--- a/Lib/test/test_cfgparser.py
+++ b/Lib/test/test_cfgparser.py
@@ -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,