2023-12-21 14:13:31 +03:00
|
|
|
from __future__ import annotations
|
2024-01-20 14:23:03 +03:00
|
|
|
|
2020-02-12 19:29:19 +03:00
|
|
|
import pytest
|
2012-10-16 00:26:38 +04:00
|
|
|
|
2020-02-12 19:29:19 +03:00
|
|
|
from .helper import assert_image_equal, fromstring, hopper
|
2012-10-16 00:26:38 +04:00
|
|
|
|
|
|
|
|
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()
|
2012-10-16 00:26:38 +04:00
|
|
|
|
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))
|