mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 02:16:19 +03:00
Test an empty string comment in arguments removes existing comment
This commit is contained in:
parent
db76eaa12c
commit
67f5e5d272
|
@ -853,15 +853,17 @@ def test_write_comment(tmp_path):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_write_no_comment(tmp_path):
|
def test_empty_string_comment(tmp_path):
|
||||||
out = str(tmp_path / "temp.gif")
|
out = str(tmp_path / "temp.gif")
|
||||||
with Image.open("Tests/images/dispose_prev.gif") as im:
|
with Image.open("Tests/images/chi.gif") as im:
|
||||||
# Empty comment="" arg should suppress all comments
|
assert "comment" in im.info
|
||||||
|
|
||||||
|
# Empty string comment should suppress existing comment
|
||||||
im.save(out, save_all=True, comment="")
|
im.save(out, save_all=True, comment="")
|
||||||
with Image.open(out) as reread:
|
|
||||||
assert "comment" not in reread.info
|
with Image.open(out) as reread:
|
||||||
for frame in ImageSequence.Iterator(reread):
|
for frame in ImageSequence.Iterator(reread):
|
||||||
assert "comment" not in frame.info
|
assert "comment" not in frame.info
|
||||||
|
|
||||||
|
|
||||||
def test_version(tmp_path):
|
def test_version(tmp_path):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user