mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-30779: IDLE: fix changes.delete_section calls in configdialog (#2667)
Also improve test of config.ConfigChanges.delete_section. Original patch by Cheryl Sabella.
This commit is contained in:
parent
f52325598e
commit
6d13b22e3a
3 changed files with 9 additions and 5 deletions
|
@ -188,6 +188,7 @@ class ChangesTest(unittest.TestCase):
|
|||
userkeys.remove_section('Ksec')
|
||||
|
||||
def test_save_help(self):
|
||||
# Any change to HelpFiles overwrites entire section.
|
||||
changes = self.changes
|
||||
changes.save_option('main', 'HelpFiles', 'IDLE', 'idledoc')
|
||||
changes.add_option('main', 'HelpFiles', 'ELDI', 'codeldi')
|
||||
|
@ -207,10 +208,12 @@ class ChangesTest(unittest.TestCase):
|
|||
changes.delete_section('main', 'fake') # Test no exception.
|
||||
self.assertEqual(changes, self.loaded) # Test nothing deleted.
|
||||
for cfgtype, section in (('main', 'Msec'), ('keys', 'Ksec')):
|
||||
testcfg[cfgtype].SetOption(section, 'name', 'value')
|
||||
changes.delete_section(cfgtype, section)
|
||||
with self.assertRaises(KeyError):
|
||||
changes[cfgtype][section] # Test section gone.
|
||||
# TODO Test change to userkeys and maybe save call.
|
||||
changes[cfgtype][section] # Test section gone from changes
|
||||
testcfg[cfgtype][section] # and from mock userCfg.
|
||||
# TODO test for save call.
|
||||
|
||||
def test_clear(self):
|
||||
changes = self.load()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue