diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2011-08-17 19:09:53 +0200 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2011-08-17 19:09:53 +0200 |
commit | 235aec27487a8a247269a444be0198f6b47731cb (patch) | |
tree | 14dfbf0ec7bb8341e8e7efe7b130ec0a1525964e /test/xmp.py | |
parent | 7457fbcbd52fdb8f0be56b80e4dc889d46faad59 (diff) | |
download | pyexiv2-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.py | 8 |
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): |