Pillow/Tests/test_image_tobitmap.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
351 B
Python
Raw Normal View History

from __future__ import annotations
2024-01-20 14:23:03 +03:00
2020-02-12 19:29:19 +03:00
import pytest
2020-02-12 19:29:19 +03:00
from .helper import assert_image_equal, fromstring, hopper
2024-01-25 14:18:46 +03:00
def test_sanity() -> None:
2020-02-12 19:29:19 +03:00
with pytest.raises(ValueError):
hopper().tobitmap()
2020-02-12 19:29:19 +03:00
im1 = hopper().convert("1")
2014-06-10 13:10:47 +04:00
2020-02-12 19:29:19 +03:00
bitmap = im1.tobitmap()
assert isinstance(bitmap, bytes)
assert_image_equal(im1, fromstring(bitmap))