mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +00:00
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.
This commit is contained in:
parent
1660933d23
commit
b12f0b581a
4 changed files with 19 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue