~osomon/pyexiv2/pyexiv2-0.3

« back to all changes in this revision

Viewing changes to test/testutils.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:
27
27
#
28
28
# ******************************************************************************
29
29
 
 
30
import os.path
30
31
import hashlib
31
32
 
 
33
 
 
34
def get_absolute_file_path(filepath):
 
35
    """
 
36
    Return the absolute file path for the file path given in argument,
 
37
    considering it is relative to the caller script's directory.
 
38
    """
 
39
    return os.path.join(os.path.dirname(os.path.abspath(__file__)), filepath)
 
40
 
 
41
 
32
42
def CheckFileSum(filename, md5sum):
33
43
    """
34
44
    Test the MD5 sum of a given file against the expected value.