Skip to content

Commit d85fa7a

Browse files
committed
Improved WmfImagePlugin test coverage
1 parent d80cf0e commit d85fa7a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Tests/test_file_wmf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ def test_load_zero_inch() -> None:
4444
pass
4545

4646

47+
def test_load_unsupported_wmf() -> None:
48+
b = BytesIO(b"\xd7\xcd\xc6\x9a\x00\x00" + b"\x01" * 10)
49+
with pytest.raises(SyntaxError, match="Unsupported WMF file format"):
50+
WmfImagePlugin.WmfStubImageFile(b)
51+
52+
53+
def test_load_unsupported() -> None:
54+
b = BytesIO(b"\x01\x00\x00\x00")
55+
with pytest.raises(SyntaxError, match="Unsupported file format"):
56+
WmfImagePlugin.WmfStubImageFile(b)
57+
58+
4759
def test_render() -> None:
4860
with open("Tests/images/drawing.emf", "rb") as fp:
4961
data = fp.read()

0 commit comments

Comments
 (0)