Pillow/Tests/test_image_frombytes.py

15 lines
385 B
Python
Raw Normal View History

from PIL import Image
from .helper import PillowTestCase, assert_image_equal, hopper
2014-06-10 13:10:47 +04:00
class TestImageFromBytes(PillowTestCase):
def test_sanity(self):
im1 = hopper()
2014-06-10 13:10:47 +04:00
im2 = Image.frombytes(im1.mode, im1.size, im1.tobytes())
assert_image_equal(im1, im2)
2014-06-10 13:10:47 +04:00
2017-09-01 13:36:51 +03:00
def test_not_implemented(self):
self.assertRaises(NotImplementedError, Image.fromstring)