Skip to content

Commit 02f99c5

Browse files
authored
Merge pull request #3155 from radarhere/legacy_api_test
Corrected test
2 parents b5357c4 + 5ef5a3c commit 02f99c5

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Tests/test_file_tiff.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ def test_wrong_bits_per_sample(self):
6363
im.load()
6464

6565
def test_set_legacy_api(self):
66-
with self.assertRaises(Exception):
67-
ImageFileDirectory_v2.legacy_api = None
66+
ifd = TiffImagePlugin.ImageFileDirectory_v2()
67+
with self.assertRaises(Exception) as e:
68+
ifd.legacy_api = None
69+
self.assertEqual(str(e.exception),
70+
"Not allowing setting of legacy api")
6871

6972
def test_xyres_tiff(self):
7073
filename = "Tests/images/pil168.tif"

0 commit comments

Comments
 (0)