Pillow/Tests/test_image_tobitmap.py

16 lines
367 B
Python
Raw Normal View History

from .helper import PillowTestCase, hopper, fromstring
2014-06-10 13:10:47 +04:00
class TestImageToBitmap(PillowTestCase):
2014-06-10 13:10:47 +04:00
def test_sanity(self):
self.assertRaises(ValueError, lambda: hopper().tobitmap())
im1 = hopper().convert("1")
2014-06-10 13:10:47 +04:00
bitmap = im1.tobitmap()
self.assertIsInstance(bitmap, bytes)
self.assert_image_equal(im1, fromstring(bitmap))