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

Method test_configure_data

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

Source from the content-addressed store, hash-verified

129 self.assertEqual(self.root.splitlist(actual), expected)
130
131 def test_configure_data(self):
132 image = tkinter.BitmapImage('::img::test', master=self.root)
133 self.assertEqual(image['data'], '-data {} {} {} {}')
134 with open(self.testfile, 'rb') as f:
135 data = f.read()
136 image.configure(data=data)
137 self.assertEqualStrList(image['data'],
138 ('-data', '', '', '', data.decode('ascii')))
139 self.assertEqual(image.width(), 16)
140 self.assertEqual(image.height(), 16)
141
142 self.assertEqual(image['maskdata'], '-maskdata {} {} {} {}')
143 image.configure(maskdata=data)
144 self.assertEqualStrList(image['maskdata'],
145 ('-maskdata', '', '', '', data.decode('ascii')))
146
147 def test_configure_file(self):
148 image = tkinter.BitmapImage('::img::test', master=self.root)

Callers

nothing calls this directly

Calls 8

assertEqualStrListMethod · 0.95
heightMethod · 0.80
openFunction · 0.50
assertEqualMethod · 0.45
readMethod · 0.45
configureMethod · 0.45
decodeMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected