]> git.ozlabs.org Git - patchwork/commitdiff
tests: Find test data relative to file location
authorDirk Wallenstein <halsmit@t-online.de>
Thu, 3 May 2012 02:45:39 +0000 (02:45 +0000)
committerJeremy Kerr <jk@ozlabs.org>
Fri, 4 May 2012 00:47:45 +0000 (08:47 +0800)
Make test execution independent of the current directory.

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/tests/utils.py

index 1cb5dfb95d529375b980d4629b7855790384ae55..f340f096e9021c6180d4856e345bec055f0e3eb3 100644 (file)
@@ -32,8 +32,8 @@ except ImportError:
     from email.MIMEMultipart import MIMEMultipart
 
 # helper functions for tests
-_test_mail_dir  = 'patchwork/tests/mail'
-_test_patch_dir = 'patchwork/tests/patches'
+_test_mail_dir  = os.path.join(os.path.dirname(__file__), 'mail')
+_test_patch_dir = os.path.join(os.path.dirname(__file__), 'patches')
 
 class defaults(object):
     project = Project(linkname = 'test-project', name = 'Test Project')