diff options
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 |