mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-21 20:54:47 +03:00
Added test
This commit is contained in:
parent
aebf54a47b
commit
133d0fb223
BIN
Tests/images/hopper_resized.gif
Normal file
BIN
Tests/images/hopper_resized.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
|
@ -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():
|
||||
|
|
Loading…
Reference in New Issue
Block a user