diff options
author | terryjreedy <tjreedy@udel.edu> | 2017-07-11 23:50:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-11 23:50:10 (GMT) |
commit | c0179483f13be81910ed73889dcad92528e20ef2 (patch) | |
tree | 256e73f5a012fa4fc8da24a01df698370a122a34 /Lib/idlelib/idle_test | |
parent | 675c1adfe5c87573e81fb295ccad7b6cfa03a3ee (diff) | |
download | cpython-c0179483f13be81910ed73889dcad92528e20ef2.zip cpython-c0179483f13be81910ed73889dcad92528e20ef2.tar.gz cpython-c0179483f13be81910ed73889dcad92528e20ef2.tar.bz2 |
[3.6] bpo-30779: IDLE: fix changes.delete_section calls in configdialog (GH-2667) (#2674)
Also improve test of config.ConfigChanges.delete_section.
Original patch by Cheryl Sabella.
(cherry picked from commit 6d13b22)
Diffstat (limited to 'Lib/idlelib/idle_test')
-rw-r--r-- | Lib/idlelib/idle_test/test_config.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/idlelib/idle_test/test_config.py b/Lib/idlelib/idle_test/test_config.py index e157bbb..a8e3a3b 100644 --- a/Lib/idlelib/idle_test/test_config.py +++ b/Lib/idlelib/idle_test/test_config.py @@ -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() |