summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cfgparser.py
diff options
context:
space:
mode:
authorFacundo Batista <facundobatista@gmail.com>2008-02-23 12:46:10 (GMT)
committerFacundo Batista <facundobatista@gmail.com>2008-02-23 12:46:10 (GMT)
commitb12f0b581a6f268d0611c87012d1273aeca220b8 (patch)
tree15cd0ffb90086c018c9542aa516b988aff18bde1 /Lib/test/test_cfgparser.py
parent1660933d23ed99393c2ea9bbe0204318936e3bbc (diff)
downloadcpython-b12f0b581a6f268d0611c87012d1273aeca220b8.zip
cpython-b12f0b581a6f268d0611c87012d1273aeca220b8.tar.gz
cpython-b12f0b581a6f268d0611c87012d1273aeca220b8.tar.bz2
Issue 1781. Now ConfigParser.add_section does not let you add a
DEFAULT section any more, because it duplicated sections with the rest of the machinery. Thanks Tim Lesher and Manuel Kaufmann.
Diffstat (limited to 'Lib/test/test_cfgparser.py')
-rw-r--r--Lib/test/test_cfgparser.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_cfgparser.py b/Lib/test/test_cfgparser.py
index c4df741..a8b5d7c 100644
--- a/Lib/test/test_cfgparser.py
+++ b/Lib/test/test_cfgparser.py
@@ -446,6 +446,14 @@ class SafeConfigParserTestCase(ConfigParserTestCase):
self.assertRaises(TypeError, cf.set, "sect", "option2", 1.0)
self.assertRaises(TypeError, cf.set, "sect", "option2", object())
+ def test_add_section_default_1(self):
+ cf = self.newconfig()
+ self.assertRaises(ValueError, cf.add_section, "default")
+
+ def test_add_section_default_2(self):
+ cf = self.newconfig()
+ self.assertRaises(ValueError, cf.add_section, "DEFAULT")
+
class SortedTestCase(RawConfigParserTestCase):
def newconfig(self, defaults=None):
self.cf = self.config_class(defaults=defaults, dict_type=SortedDict)