From 6eb570ceb7c66f5fe5b074d9c96b015fb89723e0 Mon Sep 17 00:00:00 2001 From: Jorge Gallegos Date: Thu, 7 Apr 2016 10:36:42 -0700 Subject: [PATCH] Adding a test that showcases the bug I found a couple of images where the ISOSpeedRatings value is an empty tuple. This makes sigal sad. --- tests/test_image.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_image.py b/tests/test_image.py index 3b55412..077ae22 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -137,6 +137,20 @@ def test_get_exif_tags(): assert 'gps' not in simple +def test_iso_speed_ratings(): + data = {'ISOSpeedRatings': ()} + simple = get_exif_tags(data) + assert 'iso' not in simple + + data = {'ISOSpeedRatings': None} + simple = get_exif_tags(data) + assert 'iso' not in simple + + data = {'ISOSpeedRatings': 125} + simple = get_exif_tags(data) + assert 'iso' in simple + + def test_null_exposure_time(): data = {'ExposureTime': (0, 0)} simple = get_exif_tags(data)