do not use as_dict anywhere in tests except tests for as_dict warnings

This commit is contained in:
homm 2016-07-12 19:23:44 +03:00
parent c2b4ff5fa4
commit 107307dfc9
2 changed files with 3 additions and 3 deletions

View File

@ -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"

View File

@ -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)