From 9ff8ca03601b4207c427cc2c0f9373da75b48675 Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Wed, 6 Feb 2008 23:29:29 +0100 Subject: Added a test to the unit test for bug #183332. --- unittest/Bug183332_TestCase.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'unittest/Bug183332_TestCase.py') 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. -- cgit