diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2009-01-22 21:17:50 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2009-01-22 21:17:50 +0100 |
commit | ec5e7507e774d9b246453ab8bdabf338a54f873b (patch) | |
tree | 546b3d7579d54a2242a477ff8badd256d0654d74 /unittest | |
parent | 579511a60f05d99827223fd062b072c83a4e9744 (diff) | |
download | pyexiv2-ec5e7507e774d9b246453ab8bdabf338a54f873b.tar.gz |
XMP MIMEType conversion + unit tests.
Diffstat (limited to 'unittest')
-rw-r--r-- | unittest/xmp.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/unittest/xmp.py b/unittest/xmp.py index 1ed8725..53969dd 100644 --- a/unittest/xmp.py +++ b/unittest/xmp.py @@ -88,4 +88,16 @@ class TestXmpTag(unittest.TestCase): # FIXME: the following test should not fail: having hours without minutes is not a valid syntax. self.assertEqual(XmpTag._convert_to_python('2009-01-22T21', xtype), '2009-01-22T21') + def test_convert_to_python_mimetype(self): + xtype = 'MIMEType' + # Valid values + self.assertEqual(XmpTag._convert_to_python('image/jpeg', xtype), + {'type': 'image', 'subtype': 'jpeg'}) + self.assertEqual(XmpTag._convert_to_python('video/ogg', xtype), + {'type': 'video', 'subtype': 'ogg'}) + # Invalid values + self.assertEqual(XmpTag._convert_to_python('invalid', xtype), 'invalid') + self.assertEqual(XmpTag._convert_to_python('image-jpeg', xtype), 'image-jpeg') + + # TODO: other types |