diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2010-12-22 18:16:01 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2010-12-22 18:16:01 +0100 |
commit | 59ee4d6f36aaaea03dc9ffcacaf338903392db06 (patch) | |
tree | 1fa65e44127ce84c529a82e10bba6fb969d00229 /test/iptc.py | |
parent | 6569f59296eb4ac29123c0c7adfead5929978acb (diff) | |
download | pyexiv2-59ee4d6f36aaaea03dc9ffcacaf338903392db06.tar.gz |
Fix the IPTC Time type to string conversion,
the string expected by exiv2's TimeValue::read(string) does not respect the IPTC specification
('%H:%M:%S±%H:%M' instead of '%H%M%S±%H%M).
Diffstat (limited to 'test/iptc.py')
-rw-r--r-- | test/iptc.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/iptc.py b/test/iptc.py index ead0f47..9cf198e 100644 --- a/test/iptc.py +++ b/test/iptc.py @@ -137,25 +137,25 @@ class TestIptcTag(unittest.TestCase): tag = IptcTag('Iptc.Envelope.TimeSent') self.assertEqual(tag.type, 'Time') self.assertEqual(tag._convert_to_string(datetime.time(10, 52, 4)), - '105204+0000') + '10:52:04+00:00') self.assertEqual(tag._convert_to_string(datetime.time(10, 52, 4, 574)), - '105204+0000') + '10:52:04+00:00') self.assertEqual(tag._convert_to_string(datetime.time(10, 52, 4, tzinfo=FixedOffset())), - '105204+0000') + '10:52:04+00:00') self.assertEqual(tag._convert_to_string(datetime.time(10, 52, 4, tzinfo=FixedOffset('+', 5, 30))), - '105204+0530') + '10:52:04+05:30') self.assertEqual(tag._convert_to_string(datetime.time(10, 52, 4, tzinfo=FixedOffset('-', 4, 0))), - '105204-0400') + '10:52:04-04:00') self.assertEqual(tag._convert_to_string(datetime.datetime(2007, 2, 7, 10, 52, 4)), - '105204+0000') + '10:52:04+00:00') self.assertEqual(tag._convert_to_string(datetime.datetime(2007, 2, 7, 10, 52, 4, 478)), - '105204+0000') + '10:52:04+00:00') self.assertEqual(tag._convert_to_string(datetime.datetime(2007, 2, 7, 10, 52, 4, tzinfo=FixedOffset())), - '105204+0000') + '10:52:04+00:00') self.assertEqual(tag._convert_to_string(datetime.datetime(2007, 2, 7, 10, 52, 4, tzinfo=FixedOffset('+', 5, 30))), - '105204+0530') + '10:52:04+05:30') self.assertEqual(tag._convert_to_string(datetime.datetime(2007, 2, 7, 10, 52, 4, tzinfo=FixedOffset('-', 4, 0))), - '105204-0400') + '10:52:04-04:00') # Invalid values self.failUnlessRaises(IptcValueError, tag._convert_to_string, 'invalid') |