aboutsummaryrefslogtreecommitdiffstats
path: root/test/metadata.py
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2010-02-17 22:35:35 +0100
committerOlivier Tilloy <olivier@tilloy.net>2010-02-17 22:35:35 +0100
commit084d3d8e8525f6088ef2ac0ba83d93a5bb5c0daf (patch)
treebc63b61ef3b8fa971b16ed049b737ea37a96c64b /test/metadata.py
parent6f165359c2e67e35b328fdb5b6ad6aa8f22cdab9 (diff)
downloadpyexiv2-084d3d8e8525f6088ef2ac0ba83d93a5bb5c0daf.tar.gz
Direct value assignment as an alternative to passing a fully-formed tag.
Diffstat (limited to 'test/metadata.py')
-rw-r--r--test/metadata.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/metadata.py b/test/metadata.py
index 4ef933d..200c6ea 100644
--- a/test/metadata.py
+++ b/test/metadata.py
@@ -260,7 +260,7 @@ class TestImageMetadata(unittest.TestCase):
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.metadata._set_exif_tag(tag.key, 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})
@@ -275,7 +275,7 @@ class TestImageMetadata(unittest.TestCase):
# Overwrite an existing tag
tag = ExifTag('Exif.Image.DateTime', datetime.datetime(2009, 3, 20, 20, 32, 0))
self.assertEqual(tag.metadata, None)
- self.metadata._set_exif_tag(tag)
+ self.metadata._set_exif_tag(tag.key, tag)
self.assertEqual(tag.metadata, self.metadata)
self.assertEqual(self.metadata._tags['exif'], {tag.key: tag})
self.assert_(self.metadata._image.tags['exif'].has_key(tag.key))
@@ -292,7 +292,7 @@ class TestImageMetadata(unittest.TestCase):
self.assertEqual(self.metadata._tags['exif'][key], tag)
new_tag = ExifTag(key, '48 50 50 48 ', _tag=_ExifTagMock(key, 'Undefined', '48 50 50 48 ', '2.20'))
self.assertEqual(new_tag.metadata, None)
- self.metadata._set_exif_tag(new_tag)
+ self.metadata._set_exif_tag(key, new_tag)
self.assertEqual(new_tag.metadata, self.metadata)
self.assertEqual(self.metadata._tags['exif'], {key: new_tag})
self.assert_(self.metadata._image.tags['exif'].has_key(key))
@@ -396,7 +396,7 @@ class TestImageMetadata(unittest.TestCase):
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.metadata._set_iptc_tag(tag.key, 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})
@@ -411,7 +411,7 @@ class TestImageMetadata(unittest.TestCase):
# Overwrite an existing tag
tag = IptcTag('Iptc.Application2.Caption', ['A picture.'])
self.assertEqual(tag.metadata, None)
- self.metadata._set_iptc_tag(tag)
+ self.metadata._set_iptc_tag(tag.key, tag)
self.assertEqual(tag.metadata, self.metadata)
self.assertEqual(self.metadata._tags['iptc'], {tag.key: tag})
self.assert_(self.metadata._image.tags['iptc'].has_key(tag.key))
@@ -428,7 +428,7 @@ class TestImageMetadata(unittest.TestCase):
self.assertEqual(self.metadata._tags['iptc'][key], tag)
new_tag = IptcTag(key, ['A picture.'])
self.assertEqual(new_tag.metadata, None)
- self.metadata._set_iptc_tag(new_tag)
+ self.metadata._set_iptc_tag(key, new_tag)
self.assertEqual(new_tag.metadata, self.metadata)
self.assertEqual(self.metadata._tags['iptc'], {key: new_tag})
self.assert_(self.metadata._image.tags['iptc'].has_key(key))
@@ -535,7 +535,7 @@ class TestImageMetadata(unittest.TestCase):
'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.metadata._set_xmp_tag(tag.key, 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})
@@ -550,7 +550,7 @@ class TestImageMetadata(unittest.TestCase):
# Overwrite an existing tag
tag = XmpTag('Xmp.dc.format', ('image', 'png'))
self.assertEqual(tag.metadata, None)
- self.metadata._set_xmp_tag(tag)
+ self.metadata._set_xmp_tag(tag.key, tag)
self.assertEqual(tag.metadata, self.metadata)
self.assertEqual(self.metadata._tags['xmp'], {tag.key: tag})
self.assert_(self.metadata._image.tags['xmp'].has_key(tag.key))
@@ -567,7 +567,7 @@ class TestImageMetadata(unittest.TestCase):
self.assertEqual(self.metadata._tags['xmp'][key], tag)
new_tag = XmpTag(key, datetime.datetime(2009, 4, 21, 20, 7, 0, tzinfo=FixedOffset('+', 1, 0)))
self.assertEqual(new_tag.metadata, None)
- self.metadata._set_xmp_tag(new_tag)
+ self.metadata._set_xmp_tag(key, new_tag)
self.assertEqual(new_tag.metadata, self.metadata)
self.assertEqual(self.metadata._tags['xmp'], {key: new_tag})
self.assert_(self.metadata._image.tags['xmp'].has_key(key))