(self)
| 97 | cls.testfile = support.findfile('python.xbm', subdir='tkinterdata') |
| 98 | |
| 99 | def test_create_from_file(self): |
| 100 | image = tkinter.BitmapImage('::img::test', master=self.root, |
| 101 | foreground='yellow', background='blue', |
| 102 | file=self.testfile) |
| 103 | self.assertEqual(str(image), '::img::test') |
| 104 | self.assertEqual(image.type(), 'bitmap') |
| 105 | self.assertEqual(image.width(), 16) |
| 106 | self.assertEqual(image.height(), 16) |
| 107 | self.assertIn('::img::test', self.root.image_names()) |
| 108 | del image |
| 109 | support.gc_collect() # For PyPy or other GCs. |
| 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: |
nothing calls this directly
no test coverage detected