From 79af14a148ea4d7b79db5a0f01b4db4ab590d1b1 Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Wed, 25 Feb 2009 19:38:34 +0100 Subject: IPTC Undefined to string conversion. --- unittest/iptc.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'unittest/iptc.py') diff --git a/unittest/iptc.py b/unittest/iptc.py index 70eb977..9987b9d 100644 --- a/unittest/iptc.py +++ b/unittest/iptc.py @@ -151,3 +151,13 @@ class TestIptcTag(unittest.TestCase): 'Some binary data.') self.assertEqual(IptcTag._convert_to_python('�lj1�eEϟ�u����ᒻ;C(�SpI]���QI�}', xtype), '�lj1�eEϟ�u����ᒻ;C(�SpI]���QI�}') + + def test_convert_to_string_undefined(self): + xtype = 'Undefined' + # Valid values + self.assertEqual(IptcTag._convert_to_string('Some binary data.', xtype), + 'Some binary data.') + self.assertEqual(IptcTag._convert_to_string('�lj1�eEϟ�u����ᒻ;C(�SpI]���QI�}', xtype), + '�lj1�eEϟ�u����ᒻ;C(�SpI]���QI�}') + # Invalid values + self.failUnlessRaises(IptcValueError, IptcTag._convert_to_string, None, xtype) -- cgit