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

Method test_configure

Lib/test/test_tkinter/test_font.py:23–38  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

21 cls.font = font.Font(root=cls.root, name=fontname, exists=False)
22
23 def test_configure(self):
24 options = self.font.configure()
25 self.assertGreaterEqual(set(options),
26 {'family', 'size', 'weight', 'slant', 'underline', 'overstrike'})
27 for key in options:
28 self.assertEqual(self.font.cget(key), options[key])
29 self.assertEqual(self.font[key], options[key])
30 for key in 'family', 'weight', 'slant':
31 self.assertIsInstance(options[key], str)
32 self.assertIsInstance(self.font.cget(key), str)
33 self.assertIsInstance(self.font[key], str)
34 sizetype = int if self.wantobjects else str
35 for key in 'size', 'underline', 'overstrike':
36 self.assertIsInstance(options[key], sizetype)
37 self.assertIsInstance(self.font.cget(key), sizetype)
38 self.assertIsInstance(self.font[key], sizetype)
39
40 def test_unicode_family(self):
41 family = 'MS \u30b4\u30b7\u30c3\u30af'

Callers

nothing calls this directly

Calls 6

setFunction · 0.85
assertGreaterEqualMethod · 0.80
assertIsInstanceMethod · 0.80
configureMethod · 0.45
assertEqualMethod · 0.45
cgetMethod · 0.45

Tested by

no test coverage detected