~osomon/pyexiv2/pyexiv2-0.3

« back to all changes in this revision

Viewing changes to test/ReadMetadataTestCase.py

  • Committer: Olivier Tilloy
  • Date: 2010-04-14 09:29:39 UTC
  • mto: This revision was merged to the branch mainline in revision 303.
  • Revision ID: olivier@tilloy.net-20100414092939-xjit26487s5t3ev0
Allow running the unit tests from anywhere.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        """
59
59
        # Check that the reference file is not corrupted
60
60
        filename = os.path.join('data', 'smiley1.jpg')
 
61
        filepath = testutils.get_absolute_file_path(filename)
61
62
        md5sum = 'c066958457c685853293058f9bf129c1'
62
 
        self.assertCorrectFile(filename, md5sum)
 
63
        self.assertCorrectFile(filepath, md5sum)
63
64
 
64
65
        # Read the image metadata
65
 
        image = pyexiv2.ImageMetadata(filename)
 
66
        image = pyexiv2.ImageMetadata(filepath)
66
67
        image.read()
67
68
 
68
69
        # Exhaustive tests on the values of EXIF metadata
100
101
 
101
102
    def testReadMetadataXMP(self):
102
103
        filename = os.path.join('data', 'exiv2-bug540.jpg')
 
104
        filepath = testutils.get_absolute_file_path(filename)
103
105
        md5sum = '64d4b7eab1e78f1f6bfb3c966e99eef2'
104
 
        self.assertCorrectFile(filename, md5sum)
 
106
        self.assertCorrectFile(filepath, md5sum)
105
107
 
106
108
        # Read the image metadata
107
 
        image = pyexiv2.ImageMetadata(filename)
 
109
        image = pyexiv2.ImageMetadata(filepath)
108
110
        image.read()
109
111
 
110
112
        xmpTags = [('Xmp.dc.creator', list, [u'Ian Britton']),