aboutsummaryrefslogtreecommitdiffstats
path: root/unittest
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2009-02-24 09:37:53 +0100
committerOlivier Tilloy <olivier@tilloy.net>2009-02-24 09:37:53 +0100
commit6cb7e04dbde3309e575223ec5dc09cc85e61ff11 (patch)
treeb5203151c843ef29caff7cb5d5469e8ba5e65754 /unittest
parente1ced824d8897bf1a44922e51823592e43988db5 (diff)
downloadpyexiv2-6cb7e04dbde3309e575223ec5dc09cc85e61ff11.tar.gz
IPTC String conversion.
Diffstat (limited to 'unittest')
-rw-r--r--unittest/iptc.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/unittest/iptc.py b/unittest/iptc.py
index 4ed0dc3..035b435 100644
--- a/unittest/iptc.py
+++ b/unittest/iptc.py
@@ -42,4 +42,13 @@ class TestIptcTag(unittest.TestCase):
self.failUnlessRaises(IptcValueError, IptcTag._convert_to_python, '47.0001', xtype)
self.failUnlessRaises(IptcValueError, IptcTag._convert_to_python, '1E3', xtype)
+ def test_convert_to_python_string(self):
+ xtype = 'String'
+ # Valid values
+ self.assertEqual(IptcTag._convert_to_python('Some text.', xtype), u'Some text.')
+ self.assertEqual(IptcTag._convert_to_python('Some text with exotic chàräctérʐ.', xtype),
+ u'Some text with exotic chàräctérʐ.')
+ # Invalid values
+ self.failUnlessRaises(IptcValueError, IptcTag._convert_to_python, None, xtype)
+
# TODO: other types