From b7a68a833a996bf490c602d6ff318fbf73997329 Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Mon, 15 Feb 2010 18:24:12 +0100 Subject: Make the unit tests choke on bug #522216. --- test/metadata.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/metadata.py') diff --git a/test/metadata.py b/test/metadata.py index 6f66bfe..4ef933d 100644 --- a/test/metadata.py +++ b/test/metadata.py @@ -259,8 +259,10 @@ class TestImageMetadata(unittest.TestCase): # Create a new tag tag = ExifTag('Exif.Thumbnail.Orientation', 1) self.assertEqual(tag.metadata, None) + self.assert_(tag.key not in self.metadata.exif_keys) self.metadata._set_exif_tag(tag) self.assertEqual(tag.metadata, self.metadata) + self.assert_(tag.key in self.metadata.exif_keys) self.assertEqual(self.metadata._tags['exif'], {tag.key: tag}) self.assert_(self.metadata._image.tags['exif'].has_key(tag.key)) self.assertEqual(self.metadata._image.tags['exif'][tag.key], @@ -393,8 +395,10 @@ class TestImageMetadata(unittest.TestCase): # Create a new tag tag = IptcTag('Iptc.Application2.Writer', ['Nobody']) self.assertEqual(tag.metadata, None) + self.assert_(tag.key not in self.metadata.iptc_keys) self.metadata._set_iptc_tag(tag) self.assertEqual(tag.metadata, self.metadata) + self.assert_(tag.key in self.metadata.iptc_keys) self.assertEqual(self.metadata._tags['iptc'], {tag.key: tag}) self.assert_(self.metadata._image.tags['iptc'].has_key(tag.key)) self.assertEqual(self.metadata._image.tags['iptc'][tag.key], @@ -530,8 +534,10 @@ class TestImageMetadata(unittest.TestCase): tag = XmpTag('Xmp.dc.title', {'x-default': 'This is not a title', 'fr-FR': "Ceci n'est pas un titre"}) self.assertEqual(tag.metadata, None) + self.assert_(tag.key not in self.metadata.xmp_keys) self.metadata._set_xmp_tag(tag) self.assertEqual(tag.metadata, self.metadata) + self.assert_(tag.key in self.metadata.xmp_keys) self.assertEqual(self.metadata._tags['xmp'], {tag.key: tag}) self.assert_(self.metadata._image.tags['xmp'].has_key(tag.key)) self.assertEqual(self.metadata._image.tags['xmp'][tag.key], -- cgit