mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-15 20:06:28 +03:00
25 lines
474 B
Python
25 lines
474 B
Python
from helper import unittest, PillowTestCase, lena
|
|
|
|
from PIL import Image
|
|
|
|
|
|
class TestImage(PillowTestCase):
|
|
|
|
def test_sanity(self):
|
|
|
|
self.assertRaises(ValueError, lambda: lena().tobitmap())
|
|
assert_no_exception(lambda: lena().convert("1").tobitmap())
|
|
|
|
im1 = lena().convert("1")
|
|
|
|
bitmap = im1.tobitmap()
|
|
|
|
assert_true(isinstance(bitmap, bytes))
|
|
assert_image_equal(im1, fromstring(bitmap))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|
|
|
|
# End of file
|