MCPcopy Index your code
hub / github.com/python/cpython / test_get_highlight

Method test_get_highlight

Lib/idlelib/idle_test/test_config.py:357–373  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

355 conf.GetSectionList('default', 'notexists')
356
357 def test_get_highlight(self):
358 conf = self.mock_config()
359
360 eq = self.assertEqual
361 eq(conf.GetHighlight('IDLE Classic', 'normal'), {'foreground': '#000000',
362 'background': '#ffffff'})
363
364 # Test cursor (this background should be normal-background)
365 eq(conf.GetHighlight('IDLE Classic', 'cursor'), {'foreground': 'black',
366 'background': '#ffffff'})
367
368 # Test get user themes
369 conf.SetOption('highlight', 'Foobar', 'normal-foreground', '#747474')
370 conf.SetOption('highlight', 'Foobar', 'normal-background', '#171717')
371 with mock.patch('idlelib.config._warn'):
372 eq(conf.GetHighlight('Foobar', 'normal'), {'foreground': '#747474',
373 'background': '#171717'})
374
375 def test_get_theme_dict(self):
376 # TODO: finish.

Callers

nothing calls this directly

Calls 4

mock_configMethod · 0.95
eqFunction · 0.85
GetHighlightMethod · 0.80
SetOptionMethod · 0.45

Tested by

no test coverage detected