From 063b2729c2ad04b0b5385b369873294b51655bde Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Wed, 17 Nov 2010 09:19:33 +0100 Subject: Throw an exception instead of silently failing when unable to parse the raw value for EXIF and IPTC tags. Note that parsing never fails for XMP tags. Added corresponding unit tests. --- test/iptc.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/iptc.py') diff --git a/test/iptc.py b/test/iptc.py index 3b151a5..1940efd 100644 --- a/test/iptc.py +++ b/test/iptc.py @@ -190,3 +190,8 @@ class TestIptcTag(unittest.TestCase): tag.values = ['Barcelona'] self.failIfEqual(tag.values, old_values) + def test_set_raw_values_invalid(self): + tag = IptcTag('Iptc.Envelope.DateSent') + values = ['foo'] + self.failUnlessRaises(ValueError, tag._set_raw_values, values) + -- cgit