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

Method test_put

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

Source from the content-addressed store, hash-verified

489 self.checkImgTrans(image4, {(0, 2), (1, 1), (2, 0)})
490
491 def test_put(self):
492 image = self.create()
493 image.put('{red green} {blue yellow}', to=(4, 6))
494 self.assertEqual(image.get(4, 6), self.colorlist(255, 0, 0))
495 self.assertEqual(image.get(5, 6),
496 self.colorlist(0, 128 if tkinter.TkVersion >= 8.6
497 else 255, 0))
498 self.assertEqual(image.get(4, 7), self.colorlist(0, 0, 255))
499 self.assertEqual(image.get(5, 7), self.colorlist(255, 255, 0))
500
501 image.put((('#f00', '#00ff00'), ('#000000fff', '#ffffffff0000')))
502 self.assertEqual(image.get(0, 0), self.colorlist(255, 0, 0))
503 self.assertEqual(image.get(1, 0), self.colorlist(0, 255, 0))
504 self.assertEqual(image.get(0, 1), self.colorlist(0, 0, 255))
505 self.assertEqual(image.get(1, 1), self.colorlist(255, 255, 0))
506
507 def test_get(self):
508 image = self.create()

Callers

nothing calls this directly

Calls 5

colorlistMethod · 0.95
createMethod · 0.45
putMethod · 0.45
assertEqualMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected