Skip to content

Commit

Permalink
Test further scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 1, 2025
1 parent a0889ac commit fc0447c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Tests/test_file_avif.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ def test_exif(self) -> None:
exif = im.getexif()
assert exif[274] == 3

@pytest.mark.parametrize("use_bytes, orientation", [(True, 1), (False, 2)])
@pytest.mark.parametrize("use_bytes", [True, False])
@pytest.mark.parametrize("orientation", [1, 2])
def test_exif_save(
self,
tmp_path: Path,
Expand Down Expand Up @@ -393,7 +394,7 @@ def test_seek(self) -> None:
with pytest.raises(EOFError):
im.seek(1)

@pytest.mark.parametrize("subsampling", ["4:4:4", "4:2:2", "4:0:0"])
@pytest.mark.parametrize("subsampling", ["4:4:4", "4:2:2", "4:2:0", "4:0:0"])
def test_encoder_subsampling(self, tmp_path: Path, subsampling: str) -> None:
with Image.open(TEST_AVIF_FILE) as im:
test_file = str(tmp_path / "temp.avif")
Expand All @@ -405,10 +406,11 @@ def test_encoder_subsampling_invalid(self, tmp_path: Path) -> None:
with pytest.raises(ValueError):
im.save(test_file, subsampling="foo")

def test_encoder_range(self, tmp_path: Path) -> None:
@pytest.mark.parametrize("value", ["full", "limited"])
def test_encoder_range(self, tmp_path: Path, value: str) -> None:
with Image.open(TEST_AVIF_FILE) as im:
test_file = str(tmp_path / "temp.avif")
im.save(test_file, range="limited")
im.save(test_file, range=value)

def test_encoder_range_invalid(self, tmp_path: Path) -> None:
with Image.open(TEST_AVIF_FILE) as im:
Expand Down

0 comments on commit fc0447c

Please sign in to comment.