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

Method test_create_from_data

Lib/test/test_tkinter/test_images.py:112–125  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

110 self.assertNotIn('::img::test', self.root.image_names())
111
112 def test_create_from_data(self):
113 with open(self.testfile, 'rb') as f:
114 data = f.read()
115 image = tkinter.BitmapImage('::img::test', master=self.root,
116 foreground='yellow', background='blue',
117 data=data)
118 self.assertEqual(str(image), '::img::test')
119 self.assertEqual(image.type(), 'bitmap')
120 self.assertEqual(image.width(), 16)
121 self.assertEqual(image.height(), 16)
122 self.assertIn('::img::test', self.root.image_names())
123 del image
124 support.gc_collect() # For PyPy or other GCs.
125 self.assertNotIn('::img::test', self.root.image_names())
126
127 def assertEqualStrList(self, actual, expected):
128 self.assertIsInstance(actual, str)

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected