From 25152b12cce3f5bc22822a0fd0626f5284350080 Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Mon, 9 Mar 2009 19:53:17 +0100 Subject: EXIF Byte two-ways conversion. --- unittest/exif.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'unittest/exif.py') diff --git a/unittest/exif.py b/unittest/exif.py index 419b2dd..a398b27 100644 --- a/unittest/exif.py +++ b/unittest/exif.py @@ -66,6 +66,19 @@ class TestExifTag(unittest.TestCase): # Invalid values self.failUnlessRaises(ExifValueError, ExifTag._convert_to_string, None, xtype) + def test_convert_to_python_byte(self): + xtype = 'Byte' + # Valid values + self.assertEqual(ExifTag._convert_to_python('Some text', xtype, None), 'Some text') + + def test_convert_to_string_byte(self): + xtype = 'Byte' + # Valid values + self.assertEqual(ExifTag._convert_to_string('Some text', xtype), 'Some text') + self.assertEqual(ExifTag._convert_to_string(u'Some text', xtype), 'Some text') + # Invalid values + self.failUnlessRaises(ExifValueError, ExifTag._convert_to_string, None, xtype) + def test_convert_to_python_short(self): xtype = 'Short' # Valid values -- cgit