aboutsummaryrefslogtreecommitdiffstats
path: root/unittest/xmp.py
diff options
context:
space:
mode:
Diffstat (limited to 'unittest/xmp.py')
-rw-r--r--unittest/xmp.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/unittest/xmp.py b/unittest/xmp.py
index 8aaa523..d8293fa 100644
--- a/unittest/xmp.py
+++ b/unittest/xmp.py
@@ -52,7 +52,7 @@ class TestXmpTag(unittest.TestCase):
self.assertEqual(XmpTag._convert_to_string(True, xtype), 'True')
self.assertEqual(XmpTag._convert_to_string(False, xtype), 'False')
# Invalid values
- self.assertEqual(XmpTag._convert_to_string('invalid', xtype), 'invalid')
+ self.failUnlessRaises(XmpValueError, XmpTag._convert_to_string, 'invalid', xtype)
def test_convert_to_python_choice(self):
pass
@@ -161,6 +161,15 @@ class TestXmpTag(unittest.TestCase):
self.assertEqual(XmpTag._convert_to_python('Some text with exotic chàräctérʐ.', xtype),
u'Some text with exotic chàräctérʐ.')
+ def test_convert_to_string_text(self):
+ xtype = 'Text'
+ # Valid values
+ self.assertEqual(XmpTag._convert_to_string(u'Some text', xtype), 'Some text')
+ self.assertEqual(XmpTag._convert_to_string(u'Some text with exotic chàräctérʐ.', xtype),
+ 'Some text with exotic chàräctérʐ.')
+ self.assertEqual(XmpTag._convert_to_string('Some text with exotic chàräctérʐ.', xtype),
+ 'Some text with exotic chàräctérʐ.')
+
def test_convert_to_python_uri(self):
xtype = 'URI'
# Valid values