Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Aug 7, 2023
1 parent 7775b1b commit e362818
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Tests/test_file_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ def test_save_alpha(tmp_path, mode):
helper_save_as_pdf(tmp_path, mode)


def test_p_alpha(tmp_path):
# Arrange
outfile = str(tmp_path / "temp.pdf")
with Image.open("Tests/images/pil123p.png") as im:
assert im.mode == "P"
assert isinstance(im.info["transparency"], bytes)

# Act
im.save(outfile)

# Assert
with open(outfile, "rb") as fp:
contents = fp.read()
assert b"SMask" in contents


def test_monochrome(tmp_path):
# Arrange
mode = "1"
Expand Down

0 comments on commit e362818

Please sign in to comment.