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

Method test_resize

Lib/test/test_ttk/test_extensions.py:176–193  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

174
175
176 def test_resize(self):
177 x = ttk.LabeledScale(self.root)
178 x.pack(expand=True, fill='both')
179 gc_collect() # For PyPy or other GCs.
180 x.update()
181
182 width, height = x.master.winfo_width(), x.master.winfo_height()
183 width_new, height_new = width * 2, height * 2
184
185 x.value = 3
186 x.update()
187 x.master.wm_geometry("%dx%d" % (width_new, height_new))
188 self.assertEqual(int(x.label.place_info()['x']),
189 x.scale.coords()[0])
190
191 # Reset geometry
192 x.master.wm_geometry("%dx%d" % (width, height))
193 x.destroy()
194
195
196class OptionMenuTest(AbstractTkTest, unittest.TestCase):

Callers

nothing calls this directly

Calls 10

destroyMethod · 0.95
gc_collectFunction · 0.90
winfo_widthMethod · 0.80
winfo_heightMethod · 0.80
wm_geometryMethod · 0.80
place_infoMethod · 0.80
packMethod · 0.45
updateMethod · 0.45
assertEqualMethod · 0.45
coordsMethod · 0.45

Tested by

no test coverage detected