diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index b69b04e83..1226a9279 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -253,6 +253,8 @@ class TestFileTiff(PillowTestCase): self.assert_warning(DeprecationWarning, im.tag_v2.as_dict) self.assert_warning(DeprecationWarning, im.tag.as_dict) + self.assertEqual(dict(im.tag_v2), im.tag_v2.as_dict()) + self.assertEqual(dict(im.tag), im.tag.as_dict()) def test_dict(self): # Arrange @@ -264,7 +266,6 @@ class TestFileTiff(PillowTestCase): 262: 2, 296: 2, 273: (8,), 338: (1,), 277: 4, 279: (9460,), 282: 72.0, 283: 72.0, 284: 1} self.assertEqual(dict(im.tag_v2), v2_tags) - self.assertEqual(im.tag_v2.as_dict(), v2_tags) # legacy interface legacy_tags = {256: (55,), 257: (43,), 258: (8, 8, 8, 8), 259: (1,), @@ -272,7 +273,6 @@ class TestFileTiff(PillowTestCase): 279: (9460,), 282: ((720000, 10000),), 283: ((720000, 10000),), 284: (1,)} self.assertEqual(dict(im.tag), legacy_tags) - self.assertEqual(im.tag.as_dict(), legacy_tags) def test__delitem__(self): filename = "Tests/images/pil136.tiff" diff --git a/Tests/test_file_tiff_metadata.py b/Tests/test_file_tiff_metadata.py index 9c1ca0578..8f1cd2826 100644 --- a/Tests/test_file_tiff_metadata.py +++ b/Tests/test_file_tiff_metadata.py @@ -218,7 +218,7 @@ class TestFileTiffMetadata(PillowTestCase): info = TiffImagePlugin.ImageFileDirectory_v2(head) info.load(data) try: - info = info.as_dict() + info = dict(info) except ValueError: self.fail("Should not be struct value error there.") self.assertIn(33432, info)