aboutsummaryrefslogtreecommitdiffstats
path: root/test/iptc.py
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2010-05-19 22:39:17 +0200
committerOlivier Tilloy <olivier@tilloy.net>2010-05-19 22:39:17 +0200
commite8573ba3172cb5c21bda75436156632a2c7c104d (patch)
treee5e274829ae780e91633f9c764fc1c3893f1604f /test/iptc.py
parent0c2a0abd2ee15ac0d239daa8656347b550bd1d9c (diff)
downloadpyexiv2-e8573ba3172cb5c21bda75436156632a2c7c104d.tar.gz
Attach the image's IptcData to a tag when it is assigned to an image.
Remove redundant code that would set the values of a tag twice (in the tag itself, and in the image). Remove the now useless metadata attribute.
Diffstat (limited to 'test/iptc.py')
-rw-r--r--test/iptc.py18
1 files changed, 1 insertions, 17 deletions
diff --git a/test/iptc.py b/test/iptc.py
index 160c599..3b151a5 100644
--- a/test/iptc.py
+++ b/test/iptc.py
@@ -32,14 +32,6 @@ from pyexiv2.utils import FixedOffset
import datetime
-class ImageMetadataMock(object):
-
- tags = {}
-
- def _set_iptc_tag_values(self, key, values):
- self.tags[key] = values
-
-
class TestIptcTag(unittest.TestCase):
def test_convert_to_python_short(self):
@@ -192,17 +184,9 @@ class TestIptcTag(unittest.TestCase):
tag = IptcTag('Iptc.Application2.City', ['Seattle'])
self.failUnlessRaises(TypeError, tag._set_values, 'Barcelona')
- def test_set_values_no_metadata(self):
- tag = IptcTag('Iptc.Application2.City', ['Seattle'])
- old_values = tag.values
- tag.values = ['Barcelona']
- self.failIfEqual(tag.values, old_values)
-
- def test_set_values_with_metadata(self):
+ def test_set_values(self):
tag = IptcTag('Iptc.Application2.City', ['Seattle'])
- tag.metadata = ImageMetadataMock()
old_values = tag.values
tag.values = ['Barcelona']
self.failIfEqual(tag.values, old_values)
- self.assertEqual(tag.metadata.tags[tag.key], ['Barcelona'])