def test_set_value(self): tag = IptcTag('Iptc.Application2.City', ['Seattle']) old_value = tag.value tag.value = ['Barcelona'] self.failIfEqual(tag.value, old_value)
def test_set_value(): tag = IptcTag('Iptc.Application2.City', ['Seattle']) old_value = tag.value tag.value = ['Barcelona'] assert tag.value != old_value
def test_set_value_non_repeatable(): tag = IptcTag('Iptc.Application2.ReleaseDate') value = [D.today(), D.today()] with pytest.raises(KeyError): tag.value = value
def test_set_single_value_raises(): tag = IptcTag('Iptc.Application2.City', ['Seattle']) with pytest.raises(TypeError): tag.value = 'Barcelona'