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

Method test_configure_image

Lib/test/test_tkinter/test_widgets.py:331–346  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

329 self.checkIntegerParam(widget, 'height', 100, -100, 0, conv=conv)
330
331 def test_configure_image(self):
332 widget = self.create()
333 image = tkinter.PhotoImage(master=self.root, name='image1')
334 self.checkParam(widget, 'image', image, conv=str)
335 if tk_version < (8, 7):
336 errmsg = 'image "spam" doesn\'t exist&#x27;
337 else:
338 errmsg = 'image "spam" does not exist'
339 with self.assertRaises(tkinter.TclError) as cm:
340 widget['image'] = 'spam'
341 if errmsg is not None:
342 self.assertEqual(str(cm.exception), errmsg)
343 with self.assertRaises(tkinter.TclError) as cm:
344 widget.configure({'image': 'spam'})
345 if errmsg is not None:
346 self.assertEqual(str(cm.exception), errmsg)
347
348 def test_configure_menu(self):
349 widget = self.create()

Callers

nothing calls this directly

Calls 6

createMethod · 0.95
strFunction · 0.85
checkParamMethod · 0.80
assertRaisesMethod · 0.45
assertEqualMethod · 0.45
configureMethod · 0.45

Tested by

no test coverage detected