aboutsummaryrefslogtreecommitdiffstats
path: root/test/xmp.py
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2011-08-20 12:38:54 +0200
committerOlivier Tilloy <olivier@tilloy.net>2011-08-20 12:38:54 +0200
commit39ce84eb5a85f32a2f2521a7ba7d3451a1244584 (patch)
tree4a7c53cd9b6eb03d1524bcd9cb7ea4bff5be6eca /test/xmp.py
parent1349de1bbed0dd8d6e92e62b24fc39ba3da0d92d (diff)
downloadpyexiv2-39ce84eb5a85f32a2f2521a7ba7d3451a1244584.tar.gz
Use getattr, setattr and delattr where possible, instead of calling the underlying (and supposedly hidden) methods.
Diffstat (limited to 'test/xmp.py')
-rw-r--r--test/xmp.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/xmp.py b/test/xmp.py
index 6183277..ba5b0b6 100644
--- a/test/xmp.py
+++ b/test/xmp.py
@@ -359,22 +359,22 @@ class TestXmpTag(unittest.TestCase):
def test_set_value_empty(self):
tag = XmpTag('Xmp.dc.creator')
self.failUnlessEqual(tag.type, 'seq ProperName')
- self.failUnlessRaises(ValueError, tag._set_value, [])
+ self.failUnlessRaises(ValueError, setattr, tag, 'value', [])
tag = XmpTag('Xmp.dc.title')
self.failUnlessEqual(tag.type, 'Lang Alt')
- self.failUnlessRaises(ValueError, tag._set_value, {})
+ self.failUnlessRaises(ValueError, setattr, tag, 'value', {})
def test_set_value_incorrect_type(self):
# Expecting a list of values
tag = XmpTag('Xmp.dc.publisher')
self.failUnlessEqual(tag.type, 'bag ProperName')
- self.failUnlessRaises(TypeError, tag._set_value, None)
- self.failUnlessRaises(TypeError, tag._set_value, 'bleh')
+ self.failUnlessRaises(TypeError, setattr, tag, 'value', None)
+ self.failUnlessRaises(TypeError, setattr, tag, 'value', 'bleh')
# Expecting a dictionary mapping language codes to values
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, setattr, tag, 'value', None)
+ self.failUnlessRaises(TypeError, setattr, tag, 'value', ['bleh'])
def test_set_value_basestring_for_langalt(self):
tag = XmpTag('Xmp.dc.description')