aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2011-08-22 18:21:14 +0200
committerOlivier Tilloy <olivier@tilloy.net>2011-08-22 18:21:14 +0200
commitd16f4aab750bd594e0f4c0ed3c215cbcaacccc42 (patch)
tree8df98fcd5fd92c30ef9c3e3fc254be7453379499
parent34f55f38b2bbb18843b53c6804f4410d9a3f1dc1 (diff)
parentfe224083bfe70e5f81a50929ebea85f13c7ee6e0 (diff)
downloadpyexiv2-d16f4aab750bd594e0f4c0ed3c215cbcaacccc42.tar.gz
Fix a unit test so that the test suite can be run from anywhere.
-rw-r--r--test/exif.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/exif.py b/test/exif.py
index 2bfbc67..f65b526 100644
--- a/test/exif.py
+++ b/test/exif.py
@@ -30,9 +30,10 @@ from pyexiv2.exif import ExifTag, ExifValueError
from pyexiv2.metadata import ImageMetadata
from pyexiv2.utils import make_fraction
-from testutils import CheckFileSum
+import testutils
import datetime
+import os.path
class TestExifTag(unittest.TestCase):
@@ -350,10 +351,10 @@ class TestExifTag(unittest.TestCase):
self.assertEqual(tag2.type, 'Undefined')
self.failUnlessRaises(ValueError, getattr, tag2, 'value')
- filename = 'test/data/pentax-makernote.jpg'
+ filepath = testutils.get_absolute_file_path(os.path.join('data', 'pentax-makernote.jpg'))
checksum = '646804b309a4a2d31feafe9bffc5d7f0'
- self.assert_(CheckFileSum(filename, checksum))
- metadata = ImageMetadata('test/data/pentax-makernote.jpg')
+ self.assert_(testutils.CheckFileSum(filepath, checksum))
+ metadata = ImageMetadata(filepath)
metadata.read()
tag1 = metadata[tag1.key]
self.assertEqual(tag1.type, 'Short')