aboutsummaryrefslogtreecommitdiffstats
path: root/unittest/metadata.py
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2009-03-30 09:11:41 +0200
committerOlivier Tilloy <olivier@tilloy.net>2009-03-30 09:11:41 +0200
commitec39efda4910da6e0f87da76284160d3dd9ecaa6 (patch)
treee22515904955e2e0284cdbc9d3109bfe25acea93 /unittest/metadata.py
parent938d8711997d22301718d3a181d638267abb0ef6 (diff)
downloadpyexiv2-ec39efda4910da6e0f87da76284160d3dd9ecaa6.tar.gz
Dictionary-like getter for tags.
Diffstat (limited to 'unittest/metadata.py')
-rw-r--r--unittest/metadata.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/unittest/metadata.py b/unittest/metadata.py
index 029774a..661a5be 100644
--- a/unittest/metadata.py
+++ b/unittest/metadata.py
@@ -319,23 +319,23 @@ class TestImageMetadata(unittest.TestCase):
key = 'Xmp.xmp.Label'
self.failUnlessRaises(KeyError, self.metadata._get_xmp_tag, key)
- def test_get(self):
+ def test_getitem(self):
self.metadata.read()
self._set_exif_tags()
self._set_iptc_tags()
self._set_xmp_tags()
# Get existing tags
key = 'Exif.Photo.ExifVersion'
- tag = self.metadata.get(key)
+ tag = self.metadata[key]
self.assertEqual(type(tag), ExifTag)
key = 'Iptc.Application2.Caption'
- tag = self.metadata.get(key)
+ tag = self.metadata[key]
self.assertEqual(type(tag), IptcTag)
key = 'Xmp.xmp.CreateDate'
- tag = self.metadata.get(key)
+ tag = self.metadata[key]
self.assertEqual(type(tag), XmpTag)
# Try to get nonexistent tags
keys = ('Exif.Image.SamplesPerPixel', 'Iptc.Application2.FixtureId',
'Xmp.xmp.Rating', 'Wrong.Noluck.Raise')
for key in keys:
- self.failUnlessRaises(KeyError, self.metadata.get, key)
+ self.failUnlessRaises(KeyError, self.metadata.__getitem__, key)