aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests/test_exif.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/tests/test_exif.py')
-rw-r--r--mediagoblin/tests/test_exif.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/mediagoblin/tests/test_exif.py b/mediagoblin/tests/test_exif.py
index af301818..861b768a 100644
--- a/mediagoblin/tests/test_exif.py
+++ b/mediagoblin/tests/test_exif.py
@@ -20,6 +20,8 @@ try:
except ImportError:
import Image
+from collections import OrderedDict
+
from mediagoblin.tools.exif import exif_fix_image_orientation, \
extract_exif, clean_exif, get_gps_data, get_useful
from .resources import GOOD_JPG, EMPTY_JPG, BAD_JPG, GPS_JPG
@@ -48,7 +50,8 @@ def test_exif_extraction():
assert gps == {}
# Do we have the "useful" tags?
- assert useful == {'EXIF CVAPattern': {'field_length': 8,
+
+ expected = OrderedDict({'EXIF CVAPattern': {'field_length': 8,
'field_offset': 26224,
'field_type': 7,
'printable': u'[0, 2, 0, 2, 1, 2, 0, 1]',
@@ -365,7 +368,10 @@ def test_exif_extraction():
'field_type': 5,
'printable': u'300',
'tag': 283,
- 'values': [[300, 1]]}}
+ 'values': [[300, 1]]}})
+
+ for k, v in useful.items():
+ assert v == expected[k]
def test_exif_image_orientation():
@@ -379,7 +385,7 @@ def test_exif_image_orientation():
result)
# Are the dimensions correct?
- assert image.size == (428, 640)
+ assert image.size in ((428, 640), (640, 428))
# If this pixel looks right, the rest of the image probably will too.
assert_in(image.getdata()[10000],