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

Method test_font

Lib/idlelib/idle_test/test_codecontext.py:356–379  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

354 mock_update.assert_called()
355
356 def test_font(self):
357 eq = self.assertEqual
358 cc = self.cc
359
360 orig_font = cc.text['font']
361 test_font = 'TkTextFont'
362 self.assertNotEqual(orig_font, test_font)
363
364 # Ensure code context is not active.
365 if cc.context is not None:
366 cc.toggle_code_context_event()
367
368 self.font_override = test_font
369 # Nothing breaks or changes with inactive code context.
370 cc.update_font()
371
372 # Activate code context, previous font change is immediately effective.
373 cc.toggle_code_context_event()
374 eq(cc.context['font'], test_font)
375
376 # Call the font update, change is picked up.
377 self.font_override = orig_font
378 cc.update_font()
379 eq(cc.context['font'], orig_font)
380
381 def test_highlight_colors(self):
382 eq = self.assertEqual

Callers

nothing calls this directly

Calls 4

eqFunction · 0.85
assertNotEqualMethod · 0.80
update_fontMethod · 0.45

Tested by

no test coverage detected