aboutsummaryrefslogtreecommitdiffstats
path: root/test/xmp.py
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2011-08-17 19:09:53 +0200
committerOlivier Tilloy <olivier@tilloy.net>2011-08-17 19:09:53 +0200
commit235aec27487a8a247269a444be0198f6b47731cb (patch)
tree14dfbf0ec7bb8341e8e7efe7b130ec0a1525964e /test/xmp.py
parent7457fbcbd52fdb8f0be56b80e4dc889d46faad59 (diff)
downloadpyexiv2-235aec27487a8a247269a444be0198f6b47731cb.tar.gz
Be flexible and allow setting the value of a LangAlt tag to a string,
in which case it is automatically converted to {'x-default': value}.
Diffstat (limited to 'test/xmp.py')
-rw-r--r--test/xmp.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/xmp.py b/test/xmp.py
index 294cdc2..6183277 100644
--- a/test/xmp.py
+++ b/test/xmp.py
@@ -374,7 +374,13 @@ class TestXmpTag(unittest.TestCase):
tag = XmpTag('Xmp.dc.description')
self.failUnlessEqual(tag.type, 'Lang Alt')
self.failUnlessRaises(TypeError, tag._set_value, None)
- self.failUnlessRaises(TypeError, tag._set_value, 'bleh')
+ self.failUnlessRaises(TypeError, tag._set_value, ['bleh'])
+
+ def test_set_value_basestring_for_langalt(self):
+ tag = XmpTag('Xmp.dc.description')
+ self.failUnlessEqual(tag.type, 'Lang Alt')
+ tag.value = 'bleh'
+ self.failUnlessEqual(tag.value, {'x-default': 'bleh'})
class TestXmpNamespaces(unittest.TestCase):