Browse Source

Add headline test

pull/357/head
tudacs 7 years ago
parent
commit
d833573f25
  1. BIN
      tests/sample/pictures/iptcTest/3.jpg
  2. 7
      tests/test_image.py

BIN
tests/sample/pictures/iptcTest/3.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

7
tests/test_image.py

@ -181,6 +181,13 @@ def test_get_iptc_data(caplog):
test_image)
assert get_iptc_data(src_file) == {}
# Headline
test_image = '3.jpg'
src_file = os.path.join(CURRENT_DIR, 'sample', 'pictures', 'iptcTest',
test_image)
data = get_iptc_data(src_file)
assert data["headline"] == 'Ring Nebula, M57'
# Test catching the SyntaxError -- assert output
config = {'getiptcinfo.side_effect':SyntaxError}
with patch('sigal.image.IptcImagePlugin.getiptcinfo', side_effect=SyntaxError) as i:

Loading…
Cancel
Save