Skip to content

Commit 5d998d3

Browse files
committed
Improved coverage
1 parent 6b75e06 commit 5d998d3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Tests/test_file_blp.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import pytest
66

7-
from PIL import Image
7+
from PIL import BlpImagePlugin, Image
88

99
from .helper import (
1010
assert_image_equal,
@@ -38,6 +38,13 @@ def test_load_blp2_dxt1a() -> None:
3838
assert_image_equal_tofile(im, "Tests/images/blp/blp2_dxt1a.png")
3939

4040

41+
def test_invalid_file() -> None:
42+
invalid_file = "Tests/images/flower.jpg"
43+
44+
with pytest.raises(BlpImagePlugin.BLPFormatError):
45+
BlpImagePlugin.BlpImageFile(invalid_file)
46+
47+
4148
def test_save(tmp_path: Path) -> None:
4249
f = str(tmp_path / "temp.blp")
4350

0 commit comments

Comments
 (0)