aboutsummaryrefslogtreecommitdiffstats
path: root/unittest/Bug183332_TestCase.py
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2008-02-06 23:29:29 +0100
committerOlivier Tilloy <olivier@tilloy.net>2008-02-06 23:29:29 +0100
commit9ff8ca03601b4207c427cc2c0f9373da75b48675 (patch)
treeec13adbd715007f323fcf84e0bdc736811b7ced2 /unittest/Bug183332_TestCase.py
parent6985a2ede4715d2fe2366b7a1852970510312ee7 (diff)
downloadpyexiv2-9ff8ca03601b4207c427cc2c0f9373da75b48675.tar.gz
Added a test to the unit test for bug #183332.
Diffstat (limited to 'unittest/Bug183332_TestCase.py')
-rw-r--r--unittest/Bug183332_TestCase.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/unittest/Bug183332_TestCase.py b/unittest/Bug183332_TestCase.py
index 7cedcb4..ec65c73 100644
--- a/unittest/Bug183332_TestCase.py
+++ b/unittest/Bug183332_TestCase.py
@@ -43,7 +43,25 @@ class Bug183332_TestCase(unittest.TestCase):
not.
"""
- def testSetTagValue(self):
+ def testSetEXIFTagValue(self):
+ """
+ Test the value type of the internally cached metadata after setting an
+ EXIF tag.
+ """
+ # Check that the reference file is not corrupted
+ filename = os.path.join('data', 'smiley1.jpg')
+ md5sum = 'c066958457c685853293058f9bf129c1'
+ self.assert_(testutils.CheckFileSum(filename, md5sum))
+
+ image = pyexiv2.Image(filename)
+ image.readMetadata()
+ key = 'Exif.Image.Artist'
+ value = 12
+ # EXIF artist is a string, voluntarily pass an integer as argument
+ image[key] = value
+ self.assertEqual(image[key], str(value))
+
+ def testSetIPTCTagValue(self):
"""
Test the value type of the internally cached metadata after setting an
IPTC tag.