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

Method check_create_from_file

Lib/test/test_tkinter/test_images.py:190–203  ·  view source on GitHub ↗
(self, ext)

Source from the content-addressed store, hash-verified

188 return tkinter._join(args)
189
190 def check_create_from_file(self, ext):
191 testfile = support.findfile('python.' + ext, subdir='tkinterdata')
192 image = tkinter.PhotoImage('::img::test', master=self.root,
193 file=testfile)
194 self.assertEqual(str(image), '::img::test')
195 self.assertEqual(image.type(), 'photo')
196 self.assertEqual(image.width(), 16)
197 self.assertEqual(image.height(), 16)
198 self.assertEqual(image['data'], '')
199 self.assertEqual(image['file'], testfile)
200 self.assertIn('::img::test', self.root.image_names())
201 del image
202 support.gc_collect() # For PyPy or other GCs.
203 self.assertNotIn('::img::test', self.root.image_names())
204
205 def check_create_from_data(self, ext):
206 testfile = support.findfile('python.' + ext, subdir='tkinterdata')

Calls 8

strFunction · 0.85
heightMethod · 0.80
assertInMethod · 0.80
assertNotInMethod · 0.80
assertEqualMethod · 0.45
typeMethod · 0.45
widthMethod · 0.45
image_namesMethod · 0.45

Tested by

no test coverage detected