Skip to content

Commit

Permalink
Capture the expected warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Nov 7, 2020
1 parent f8685f0 commit afed94e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import mimetypes
import warnings
import pytest

from paradocx.image import ImagePart

Expand All @@ -16,7 +17,8 @@ def test_content_types():
assert part.content_type in jpeg_types
part = ImagePart(None, '/word/media/bar.jpeg')
assert part.content_type in jpeg_types
part = ImagePart(None, '/foo/bar/strange eps file.eps')
with pytest.warns(UserWarning):
part = ImagePart(None, '/foo/bar/strange eps file.eps')
assert part.content_type == 'application/postscript'
part = ImagePart(None, '/name without extension')
assert part.content_type is None
Expand Down

0 comments on commit afed94e

Please sign in to comment.