Added test

This commit is contained in:
Andrew Murray 2021-02-23 07:20:04 +11:00
parent aebf54a47b
commit 133d0fb223
2 changed files with 17 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -7,7 +7,12 @@ import pytest
from PIL import Image
from .helper import assert_image_equal, assert_image_similar, hopper
from .helper import (
assert_image_equal,
assert_image_equal_tofile,
assert_image_similar,
hopper,
)
class TestImagingCoreResize:
@ -135,6 +140,17 @@ class TestImagingCoreResize:
with pytest.raises(ValueError):
self.resize(hopper(), (10, 10), 9)
def test_cross_platform(self, tmp_path):
# This test is intended for only check for consistent behaviour across
# platforms. So if a future Pillow change requires that the test file
# be updated, that is okay.
im = hopper().resize((64, 64))
temp_file = str(tmp_path / "temp.gif")
im.save(temp_file)
with Image.open(temp_file) as reloaded:
assert_image_equal_tofile(reloaded, "Tests/images/hopper_resized.gif")
@pytest.fixture
def gradients_image():