diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2009-01-27 09:34:19 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2009-01-27 09:34:19 +0100 |
commit | 4eb5914ee396b6eb0c3f4ede4dfaa1e6107c0851 (patch) | |
tree | 61d930da4e6e327c8b5c2fc7c6a20ae80944229a /unittest/xmp.py | |
parent | 55697d8319dc62729ef53651f2fef408f06e2d50 (diff) | |
download | pyexiv2-4eb5914ee396b6eb0c3f4ede4dfaa1e6107c0851.tar.gz |
XMP ProperName conversion + unit tests.
Diffstat (limited to 'unittest/xmp.py')
-rw-r--r-- | unittest/xmp.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/unittest/xmp.py b/unittest/xmp.py index 41cf6b3..27b355d 100644 --- a/unittest/xmp.py +++ b/unittest/xmp.py @@ -127,6 +127,13 @@ class TestXmpTag(unittest.TestCase): self.assertEqual(XmpTag._convert_to_python('invalid', xtype), 'invalid') self.assertEqual(XmpTag._convert_to_python('image-jpeg', xtype), 'image-jpeg') + def test_convert_to_python_propername(self): + xtype = 'ProperName' + # Valid values + self.assertEqual(XmpTag._convert_to_python('Gérard', xtype), u'Gérard') + self.assertEqual(XmpTag._convert_to_python(u'François Pignon', xtype), u'François Pignon') + self.assertEqual(XmpTag._convert_to_python('Python Software Foundation', xtype), u'Python Software Foundation') + def test_convert_to_python_text(self): xtype = 'Text' # Valid values @@ -136,9 +143,6 @@ class TestXmpTag(unittest.TestCase): u'Some text with exotic chàräctérʐ.') self.assertEqual(XmpTag._convert_to_python(u'Some text with exotic chàräctérʐ.', xtype), u'Some text with exotic chàräctérʐ.') - # Invalid values - self.assertEqual(XmpTag._convert_to_python(12, xtype), 12) - self.assertEqual(XmpTag._convert_to_python(3.14, xtype), 3.14) def test_convert_to_python_uri(self): xtype = 'URI' |