Use isinstance to check type

This commit is contained in:
Andrew Murray 2020-12-30 22:39:49 +11:00
parent 17c48db318
commit 06b7b97a7a

View File

@ -3,7 +3,8 @@ from PIL import Image
def test_getxmp():
with Image.open("Tests/images/xmp_test.jpg") as im:
type_repr = repr(type(im.getxmp()))
xmp = im.getxmp()
assert isinstance(xmp, dict)
assert isinstance(xmp["Description"][0]["Version"], str)
assert "dict" in type_repr
assert isinstance(im.getxmp()["Description"][0]["Version"], str)