Pillow/Tests/test_image_tobitmap.py
2023-02-06 19:27:19 +00:00

16 lines
307 B
Python

import pytest
from .helper import assert_image_equal, fromstring, hopper
def test_sanity():
with pytest.raises(ValueError):
hopper().tobitmap()
im1 = hopper().convert("1")
bitmap = im1.tobitmap()
assert isinstance(bitmap, bytes)
assert_image_equal(im1, fromstring(bitmap))