diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2019-03-22 22:23:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-22 22:23:41 (GMT) |
commit | c1419578a18d787393c7ccee149e7c1fff17a99e (patch) | |
tree | 397ee6aabc58afb07ef4893676ba569f05cf7d3c /Lib/idlelib/idle_test | |
parent | 5086589305ff5538709856b27314b68f06ae93db (diff) | |
download | cpython-c1419578a18d787393c7ccee149e7c1fff17a99e.zip cpython-c1419578a18d787393c7ccee149e7c1fff17a99e.tar.gz cpython-c1419578a18d787393c7ccee149e7c1fff17a99e.tar.bz2 |
bpo-36396: Remove fgBg param of idlelib.config.GetHighlight() (GH-12491)
This param was only used once and changed the return type.
Diffstat (limited to 'Lib/idlelib/idle_test')
-rw-r--r-- | Lib/idlelib/idle_test/test_config.py | 4 | ||||
-rw-r--r-- | Lib/idlelib/idle_test/test_configdialog.py | 45 |
2 files changed, 20 insertions, 29 deletions
diff --git a/Lib/idlelib/idle_test/test_config.py b/Lib/idlelib/idle_test/test_config.py index 169d054..7e2c1fd 100644 --- a/Lib/idlelib/idle_test/test_config.py +++ b/Lib/idlelib/idle_test/test_config.py @@ -373,10 +373,6 @@ class IdleConfTest(unittest.TestCase): eq = self.assertEqual eq(conf.GetHighlight('IDLE Classic', 'normal'), {'foreground': '#000000', 'background': '#ffffff'}) - eq(conf.GetHighlight('IDLE Classic', 'normal', 'fg'), '#000000') - eq(conf.GetHighlight('IDLE Classic', 'normal', 'bg'), '#ffffff') - with self.assertRaises(config.InvalidFgBg): - conf.GetHighlight('IDLE Classic', 'normal', 'fb') # Test cursor (this background should be normal-background) eq(conf.GetHighlight('IDLE Classic', 'cursor'), {'foreground': 'black', diff --git a/Lib/idlelib/idle_test/test_configdialog.py b/Lib/idlelib/idle_test/test_configdialog.py index 5472a04..37e8343 100644 --- a/Lib/idlelib/idle_test/test_configdialog.py +++ b/Lib/idlelib/idle_test/test_configdialog.py @@ -606,40 +606,35 @@ class HighPageTest(unittest.TestCase): def test_paint_theme_sample(self): eq = self.assertEqual - d = self.page - del d.paint_theme_sample - hs_tag = d.highlight_sample.tag_cget + page = self.page + del page.paint_theme_sample # Delete masking mock. + hs_tag = page.highlight_sample.tag_cget gh = idleConf.GetHighlight - fg = 'foreground' - bg = 'background' # Create custom theme based on IDLE Dark. - d.theme_source.set(True) - d.builtin_name.set('IDLE Dark') + page.theme_source.set(True) + page.builtin_name.set('IDLE Dark') theme = 'IDLE Test' - d.create_new(theme) - d.set_color_sample.called = 0 + page.create_new(theme) + page.set_color_sample.called = 0 # Base theme with nothing in `changes`. - d.paint_theme_sample() - eq(hs_tag('break', fg), gh(theme, 'break', fgBg='fg')) - eq(hs_tag('cursor', bg), gh(theme, 'normal', fgBg='bg')) - self.assertNotEqual(hs_tag('console', fg), 'blue') - self.assertNotEqual(hs_tag('console', bg), 'yellow') - eq(d.set_color_sample.called, 1) + page.paint_theme_sample() + new_console = {'foreground': 'blue', + 'background': 'yellow',} + for key, value in new_console.items(): + self.assertNotEqual(hs_tag('console', key), value) + eq(page.set_color_sample.called, 1) # Apply changes. - changes.add_option('highlight', theme, 'console-foreground', 'blue') - changes.add_option('highlight', theme, 'console-background', 'yellow') - d.paint_theme_sample() - - eq(hs_tag('break', fg), gh(theme, 'break', fgBg='fg')) - eq(hs_tag('cursor', bg), gh(theme, 'normal', fgBg='bg')) - eq(hs_tag('console', fg), 'blue') - eq(hs_tag('console', bg), 'yellow') - eq(d.set_color_sample.called, 2) + for key, value in new_console.items(): + changes.add_option('highlight', theme, 'console-'+key, value) + page.paint_theme_sample() + for key, value in new_console.items(): + eq(hs_tag('console', key), value) + eq(page.set_color_sample.called, 2) - d.paint_theme_sample = Func() + page.paint_theme_sample = Func() def test_delete_custom(self): eq = self.assertEqual |