Skip to content

Commit

Permalink
Test RGBX raw mode
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 18, 2025
1 parent 4b7e75b commit 5d40e6a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Tests/test_file_sun.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ def test_unsupported_file_type() -> None:
pass

Check warning on line 72 in Tests/test_file_sun.py

View check run for this annotation

Codecov / codecov/patch

Tests/test_file_sun.py#L72

Added line #L72 was not covered by tests


@pytest.mark.skipif(
not os.path.exists(EXTRA_DIR), reason="Extra image files not installed"
)
def test_rgbx() -> None:
with open(os.path.join(EXTRA_DIR, "32bpp.ras"), "rb") as fp:
data = fp.read()

# Set file type to 3
data = data[:20] + _binary.o32be(3) + data[24:]

with Image.open(io.BytesIO(data)) as im:
r, g, b = im.split()
im = Image.merge("RGB", (b, g, r))
assert_image_equal_tofile(im, os.path.join(EXTRA_DIR, "32bpp.png"))


@pytest.mark.skipif(
not os.path.exists(EXTRA_DIR), reason="Extra image files not installed"
)
Expand Down

0 comments on commit 5d40e6a

Please sign in to comment.