2023-12-21 14:13:31 +03:00
|
|
|
from __future__ import annotations
|
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
|
|
|
|
|
|
|
|
2020-02-12 19:29:19 +03:00
|
|
|
def test_sanity():
|
|
|
|
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))
|