mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
20 lines
424 B
Python
20 lines
424 B
Python
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
from PIL import Image
|
|
|
|
from .helper import assert_image_equal, hopper
|
|
|
|
|
|
@pytest.mark.parametrize("data_type", ("bytes", "memoryview"))
|
|
def test_sanity(data_type: str) -> None:
|
|
im1 = hopper()
|
|
|
|
data = im1.tobytes()
|
|
if data_type == "memoryview":
|
|
data = memoryview(data)
|
|
im2 = Image.frombytes(im1.mode, im1.size, data)
|
|
|
|
assert_image_equal(im1, im2)
|