diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2008-02-06 23:29:29 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2008-02-06 23:29:29 +0100 |
commit | 9ff8ca03601b4207c427cc2c0f9373da75b48675 (patch) | |
tree | ec13adbd715007f323fcf84e0bdc736811b7ced2 /unittest/Bug183332_TestCase.py | |
parent | 6985a2ede4715d2fe2366b7a1852970510312ee7 (diff) | |
download | pyexiv2-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.py | 20 |
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. |