diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2010-05-20 13:44:53 +0200 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2010-05-20 13:44:53 +0200 |
commit | 871d02851b48a1db75068c6edc524c17ca2511a4 (patch) | |
tree | 6b1c07e527b1c3ef51ef677f56ce174389ff2195 /test/iptc.py | |
parent | 1ba51c22bfc6202f23c66b0e13418af8546cfe73 (diff) | |
parent | bb33f2b87aea2038f18b8484d3895e2757f0d72f (diff) | |
download | pyexiv2-871d02851b48a1db75068c6edc524c17ca2511a4.tar.gz |
Do not write tag values twice.
Attach the image's {Exif,Iptc,Xmp}Data to a tag when it is assigned to an image.
Remove redundant code that would set the value 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.py | 18 |
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']) |