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

Method test_layout

Lib/test/test_ttk/test_style.py:84–104  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

82
83
84 def test_layout(self):
85 style = self.style
86 self.assertRaises(tkinter.TclError, style.layout, 'NotALayout')
87 tv_style = style.layout('Treeview')
88
89 # "erase" Treeview layout
90 style.layout('Treeview', '')
91 self.assertEqual(style.layout('Treeview'),
92 [('null', {'sticky': 'nswe'})]
93 )
94
95 # restore layout
96 style.layout('Treeview', tv_style)
97 self.assertEqual(style.layout('Treeview'), tv_style)
98
99 # should return a list
100 self.assertIsInstance(style.layout('TButton'), list)
101
102 # correct layout, but "option" doesn't exist as option
103 self.assertRaises(tkinter.TclError, style.layout, 'Treeview',
104 [('name', {'option': 'inexistent'})])
105
106
107 def test_theme_use(self):

Callers

nothing calls this directly

Calls 4

layoutMethod · 0.80
assertIsInstanceMethod · 0.80
assertRaisesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected