mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 17:06:16 +03:00
Match warning message
This commit is contained in:
parent
f24222a954
commit
a3fd009875
|
@ -882,7 +882,10 @@ class TestFileJpeg:
|
||||||
def test_getxmp(self):
|
def test_getxmp(self):
|
||||||
with Image.open("Tests/images/xmp_test.jpg") as im:
|
with Image.open("Tests/images/xmp_test.jpg") as im:
|
||||||
if ElementTree is None:
|
if ElementTree is None:
|
||||||
with pytest.warns(UserWarning):
|
with pytest.warns(
|
||||||
|
UserWarning,
|
||||||
|
match="XMP data cannot be read without defusedxml dependency",
|
||||||
|
):
|
||||||
assert im.getxmp() == {}
|
assert im.getxmp() == {}
|
||||||
else:
|
else:
|
||||||
xmp = im.getxmp()
|
xmp = im.getxmp()
|
||||||
|
@ -908,7 +911,10 @@ class TestFileJpeg:
|
||||||
def test_getxmp_no_prefix(self):
|
def test_getxmp_no_prefix(self):
|
||||||
with Image.open("Tests/images/xmp_no_prefix.jpg") as im:
|
with Image.open("Tests/images/xmp_no_prefix.jpg") as im:
|
||||||
if ElementTree is None:
|
if ElementTree is None:
|
||||||
with pytest.warns(UserWarning):
|
with pytest.warns(
|
||||||
|
UserWarning,
|
||||||
|
match="XMP data cannot be read without defusedxml dependency",
|
||||||
|
):
|
||||||
assert im.getxmp() == {}
|
assert im.getxmp() == {}
|
||||||
else:
|
else:
|
||||||
assert im.getxmp() == {"xmpmeta": {"key": "value"}}
|
assert im.getxmp() == {"xmpmeta": {"key": "value"}}
|
||||||
|
@ -916,7 +922,10 @@ class TestFileJpeg:
|
||||||
def test_getxmp_padded(self):
|
def test_getxmp_padded(self):
|
||||||
with Image.open("Tests/images/xmp_padded.jpg") as im:
|
with Image.open("Tests/images/xmp_padded.jpg") as im:
|
||||||
if ElementTree is None:
|
if ElementTree is None:
|
||||||
with pytest.warns(UserWarning):
|
with pytest.warns(
|
||||||
|
UserWarning,
|
||||||
|
match="XMP data cannot be read without defusedxml dependency",
|
||||||
|
):
|
||||||
assert im.getxmp() == {}
|
assert im.getxmp() == {}
|
||||||
else:
|
else:
|
||||||
assert im.getxmp() == {"xmpmeta": None}
|
assert im.getxmp() == {"xmpmeta": None}
|
||||||
|
|
|
@ -665,7 +665,10 @@ class TestFilePng:
|
||||||
def test_getxmp(self):
|
def test_getxmp(self):
|
||||||
with Image.open("Tests/images/color_snakes.png") as im:
|
with Image.open("Tests/images/color_snakes.png") as im:
|
||||||
if ElementTree is None:
|
if ElementTree is None:
|
||||||
with pytest.warns(UserWarning):
|
with pytest.warns(
|
||||||
|
UserWarning,
|
||||||
|
match="XMP data cannot be read without defusedxml dependency",
|
||||||
|
):
|
||||||
assert im.getxmp() == {}
|
assert im.getxmp() == {}
|
||||||
else:
|
else:
|
||||||
xmp = im.getxmp()
|
xmp = im.getxmp()
|
||||||
|
|
|
@ -734,7 +734,10 @@ class TestFileTiff:
|
||||||
def test_getxmp(self):
|
def test_getxmp(self):
|
||||||
with Image.open("Tests/images/lab.tif") as im:
|
with Image.open("Tests/images/lab.tif") as im:
|
||||||
if ElementTree is None:
|
if ElementTree is None:
|
||||||
with pytest.warns(UserWarning):
|
with pytest.warns(
|
||||||
|
UserWarning,
|
||||||
|
match="XMP data cannot be read without defusedxml dependency",
|
||||||
|
):
|
||||||
assert im.getxmp() == {}
|
assert im.getxmp() == {}
|
||||||
else:
|
else:
|
||||||
xmp = im.getxmp()
|
xmp = im.getxmp()
|
||||||
|
|
|
@ -118,7 +118,10 @@ def test_getxmp():
|
||||||
|
|
||||||
with Image.open("Tests/images/flower2.webp") as im:
|
with Image.open("Tests/images/flower2.webp") as im:
|
||||||
if ElementTree is None:
|
if ElementTree is None:
|
||||||
with pytest.warns(UserWarning):
|
with pytest.warns(
|
||||||
|
UserWarning,
|
||||||
|
match="XMP data cannot be read without defusedxml dependency",
|
||||||
|
):
|
||||||
assert im.getxmp() == {}
|
assert im.getxmp() == {}
|
||||||
else:
|
else:
|
||||||
assert (
|
assert (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user