aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2012-02-18 10:01:47 -0600
committerChristopher Allan Webber <cwebber@dustycloud.org>2012-02-18 10:01:47 -0600
commit63352aaf70d97a37b6277fab0f9b957d34dcb9df (patch)
treeacdedffc204d89f1f71f09696270e5719f5e3123 /mediagoblin/tests
parent7f3ec607a34e727324397c2bf240f771b12a0455 (diff)
parentfeba5c5287a7cb4c0ed8f5124ad60a8a291770ad (diff)
downloadmediagoblin-63352aaf70d97a37b6277fab0f9b957d34dcb9df.tar.lz
mediagoblin-63352aaf70d97a37b6277fab0f9b957d34dcb9df.tar.xz
mediagoblin-63352aaf70d97a37b6277fab0f9b957d34dcb9df.zip
Merge branch 'master' into sqlmigrate
Conflicts: mediagoblin/db/sql/models.py
Diffstat (limited to 'mediagoblin/tests')
-rw-r--r--mediagoblin/tests/__init__.py2
-rw-r--r--mediagoblin/tests/fake_celery_module.py2
-rw-r--r--mediagoblin/tests/test_auth.py2
-rw-r--r--mediagoblin/tests/test_cache.py2
-rw-r--r--mediagoblin/tests/test_celery_setup.py2
-rw-r--r--mediagoblin/tests/test_config.py2
-rw-r--r--mediagoblin/tests/test_csrf_middleware.py2
-rw-r--r--mediagoblin/tests/test_edit.py2
-rw-r--r--mediagoblin/tests/test_exif.py17
-rw-r--r--mediagoblin/tests/test_globals.py2
-rw-r--r--mediagoblin/tests/test_messages.py2
-rw-r--r--mediagoblin/tests/test_migrations.py2
-rw-r--r--mediagoblin/tests/test_misc.py2
-rw-r--r--mediagoblin/tests/test_storage.py2
-rw-r--r--mediagoblin/tests/test_submission.py3
-rw-r--r--mediagoblin/tests/test_tags.py2
-rw-r--r--mediagoblin/tests/test_tests.py2
-rw-r--r--mediagoblin/tests/test_util.py2
-rw-r--r--mediagoblin/tests/test_workbench.py2
-rw-r--r--mediagoblin/tests/tools.py2
20 files changed, 33 insertions, 23 deletions
diff --git a/mediagoblin/tests/__init__.py b/mediagoblin/tests/__init__.py
index eac3dff4..15a5add0 100644
--- a/mediagoblin/tests/__init__.py
+++ b/mediagoblin/tests/__init__.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/fake_celery_module.py b/mediagoblin/tests/fake_celery_module.py
index ba347c69..621845ba 100644
--- a/mediagoblin/tests/fake_celery_module.py
+++ b/mediagoblin/tests/fake_celery_module.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_auth.py b/mediagoblin/tests/test_auth.py
index 411b4539..3a33c66c 100644
--- a/mediagoblin/tests/test_auth.py
+++ b/mediagoblin/tests/test_auth.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_cache.py b/mediagoblin/tests/test_cache.py
index cbffeb84..48fa1386 100644
--- a/mediagoblin/tests/test_cache.py
+++ b/mediagoblin/tests/test_cache.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 Free Software Foundation, Inc
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_celery_setup.py b/mediagoblin/tests/test_celery_setup.py
index 19a9b899..c9c77821 100644
--- a/mediagoblin/tests/test_celery_setup.py
+++ b/mediagoblin/tests/test_celery_setup.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_config.py b/mediagoblin/tests/test_config.py
index 0764e12d..c596f6a6 100644
--- a/mediagoblin/tests/test_config.py
+++ b/mediagoblin/tests/test_config.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_csrf_middleware.py b/mediagoblin/tests/test_csrf_middleware.py
index c8fca23a..f49dc94e 100644
--- a/mediagoblin/tests/test_csrf_middleware.py
+++ b/mediagoblin/tests/test_csrf_middleware.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_edit.py b/mediagoblin/tests/test_edit.py
index 55f34b42..398a5d25 100644
--- a/mediagoblin/tests/test_edit.py
+++ b/mediagoblin/tests/test_edit.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_exif.py b/mediagoblin/tests/test_exif.py
index 9f2219c0..ed95045c 100644
--- a/mediagoblin/tests/test_exif.py
+++ b/mediagoblin/tests/test_exif.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -21,6 +21,11 @@ import Image
from mediagoblin.tools.exif import exif_fix_image_orientation, \
extract_exif, clean_exif, get_gps_data, get_useful
+
+def assert_in(a, b):
+ assert a in b, "%r not in %r" % (a, b)
+
+
GOOD_JPG = pkg_resources.resource_filename(
'mediagoblin.tests',
os.path.join(
@@ -42,6 +47,7 @@ GPS_JPG = pkg_resources.resource_filename(
'test_exif',
'has-gps.jpg'))
+
def test_exif_extraction():
'''
Test EXIF extraction from a good image
@@ -130,6 +136,7 @@ def test_exif_extraction():
32, 32, 32],
'field_length': 44}}
+
def test_exif_image_orientation():
'''
Test image reorientation based on EXIF data
@@ -144,7 +151,10 @@ def test_exif_image_orientation():
assert image.size == (428, 640)
# If this pixel looks right, the rest of the image probably will too.
- assert image.getdata()[10000] == (41, 28, 11)
+ assert_in(image.getdata()[10000],
+ ((41, 28, 11), (43, 27, 11))
+ )
+
def test_exif_no_exif():
'''
@@ -160,6 +170,7 @@ def test_exif_no_exif():
assert gps == {}
assert useful == {}
+
def test_exif_bad_image():
'''
Test EXIF extraction from a faithful, but bad image
@@ -174,6 +185,7 @@ def test_exif_bad_image():
assert gps == {}
assert useful == {}
+
def test_exif_gps_data():
'''
Test extractiion of GPS data
@@ -186,4 +198,3 @@ def test_exif_gps_data():
'direction': 25.674046740467404,
'altitude': 37.64365671641791,
'longitude': 18.016166666666667}
-
diff --git a/mediagoblin/tests/test_globals.py b/mediagoblin/tests/test_globals.py
index 84f1c74a..98f6a436 100644
--- a/mediagoblin/tests/test_globals.py
+++ b/mediagoblin/tests/test_globals.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_messages.py b/mediagoblin/tests/test_messages.py
index 2635f4d7..d3b84828 100644
--- a/mediagoblin/tests/test_messages.py
+++ b/mediagoblin/tests/test_messages.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_migrations.py b/mediagoblin/tests/test_migrations.py
index 8e573f5a..f6e6c1a8 100644
--- a/mediagoblin/tests/test_migrations.py
+++ b/mediagoblin/tests/test_migrations.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_misc.py b/mediagoblin/tests/test_misc.py
index 09623355..94ae5a51 100644
--- a/mediagoblin/tests/test_misc.py
+++ b/mediagoblin/tests/test_misc.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_storage.py b/mediagoblin/tests/test_storage.py
index eab4d032..6fc2e57c 100644
--- a/mediagoblin/tests/test_storage.py
+++ b/mediagoblin/tests/test_storage.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_submission.py b/mediagoblin/tests/test_submission.py
index b3c11249..217926a4 100644
--- a/mediagoblin/tests/test_submission.py
+++ b/mediagoblin/tests/test_submission.py
@@ -1,6 +1,5 @@
-
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_tags.py b/mediagoblin/tests/test_tags.py
index 583c1a55..79f925aa 100644
--- a/mediagoblin/tests/test_tags.py
+++ b/mediagoblin/tests/test_tags.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_tests.py b/mediagoblin/tests/test_tests.py
index 25bb52b3..20832ac7 100644
--- a/mediagoblin/tests/test_tests.py
+++ b/mediagoblin/tests/test_tests.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_util.py b/mediagoblin/tests/test_util.py
index 48fa8669..452090e1 100644
--- a/mediagoblin/tests/test_util.py
+++ b/mediagoblin/tests/test_util.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/test_workbench.py b/mediagoblin/tests/test_workbench.py
index 977d64b9..b5243a9b 100644
--- a/mediagoblin/tests/test_workbench.py
+++ b/mediagoblin/tests/test_workbench.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
diff --git a/mediagoblin/tests/tools.py b/mediagoblin/tests/tools.py
index 49a3d33e..7cf355b0 100644
--- a/mediagoblin/tests/tools.py
+++ b/mediagoblin/tests/tools.py
@@ -1,5 +1,5 @@
# GNU MediaGoblin -- federated, autonomous media hosting
-# Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
+# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by