Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 13, 2021
1 parent c2203a1 commit 72a098b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Binary file added Tests/images/hopper_resized.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions Tests/test_image_resize.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ def test_unknown_filter(self):
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:
with Image.open("Tests/images/hopper_resized.gif") as expected:
assert_image_equal(reloaded, expected)


@pytest.fixture
def gradients_image():
Expand Down

0 comments on commit 72a098b

Please sign in to comment.