mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
Improved test coverage
This commit is contained in:
parent
f938af5c3c
commit
a34a9cd6d1
|
@ -58,10 +58,7 @@ def test_getiptcinfo_fotostation() -> None:
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
assert iptc is not None
|
assert iptc is not None
|
||||||
for tag in iptc.keys():
|
assert 240 in (tag[0] for tag in iptc.keys()), "FotoStation tag not found"
|
||||||
if tag[0] == 240:
|
|
||||||
return
|
|
||||||
pytest.fail("FotoStation tag not found")
|
|
||||||
|
|
||||||
|
|
||||||
def test_getiptcinfo_zero_padding() -> None:
|
def test_getiptcinfo_zero_padding() -> None:
|
||||||
|
|
|
@ -492,8 +492,7 @@ def test_plt_marker(card: ImageFile.ImageFile) -> None:
|
||||||
out.seek(0)
|
out.seek(0)
|
||||||
while True:
|
while True:
|
||||||
marker = out.read(2)
|
marker = out.read(2)
|
||||||
if not marker:
|
assert marker, "End of stream without PLT"
|
||||||
pytest.fail("End of stream without PLT")
|
|
||||||
|
|
||||||
jp2_boxid = _binary.i16be(marker)
|
jp2_boxid = _binary.i16be(marker)
|
||||||
if jp2_boxid == 0xFF4F:
|
if jp2_boxid == 0xFF4F:
|
||||||
|
|
|
@ -36,11 +36,7 @@ class LibTiffTestCase:
|
||||||
im.load()
|
im.load()
|
||||||
im.getdata()
|
im.getdata()
|
||||||
|
|
||||||
try:
|
assert im._compression == "group4"
|
||||||
assert im._compression == "group4"
|
|
||||||
except AttributeError:
|
|
||||||
print("No _compression")
|
|
||||||
print(dir(im))
|
|
||||||
|
|
||||||
# can we write it back out, in a different form.
|
# can we write it back out, in a different form.
|
||||||
out = str(tmp_path / "temp.png")
|
out = str(tmp_path / "temp.png")
|
||||||
|
|
|
@ -189,8 +189,6 @@ class TestImage:
|
||||||
if ext == ".jp2" and not features.check_codec("jpg_2000"):
|
if ext == ".jp2" and not features.check_codec("jpg_2000"):
|
||||||
pytest.skip("jpg_2000 not available")
|
pytest.skip("jpg_2000 not available")
|
||||||
temp_file = str(tmp_path / ("temp." + ext))
|
temp_file = str(tmp_path / ("temp." + ext))
|
||||||
if os.path.exists(temp_file):
|
|
||||||
os.remove(temp_file)
|
|
||||||
im.save(Path(temp_file))
|
im.save(Path(temp_file))
|
||||||
|
|
||||||
def test_fp_name(self, tmp_path: Path) -> None:
|
def test_fp_name(self, tmp_path: Path) -> None:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user