]> err.no Git - dak/commitdiff
Add a 'fixture' utility to generate a path to a fixture.
authorChris Lamb <lamby@debian.org>
Sat, 31 Oct 2009 15:39:46 +0000 (15:39 +0000)
committerChris Lamb <lamby@debian.org>
Sat, 31 Oct 2009 23:01:56 +0000 (23:01 +0000)
Signed-off-by: Chris Lamb <lamby@debian.org>
tests/base_test.py

index 255e71b001a537e94be3d73609f152ce69d3f785..d99ce4166c6ebae64d122bb16741df20a362c0a7 100644 (file)
@@ -5,14 +5,16 @@ import unittest
 from os.path import abspath, dirname, join
 
 DAK_ROOT_DIR = dirname(dirname(abspath(__file__)))
-DAK_TEST_FIXTURES = join(DAK_ROOT_DIR, 'tests', 'fixtures')
 
 class DakTestCase(unittest.TestCase):
     def setUp(self):
         pass
 
+def fixture(*dirs):
+    return join(DAK_ROOT_DIR, 'tests', 'fixtures', *dirs)
+
 os.environ['DAK_TEST'] = '1'
-os.environ['DAK_CONFIG'] = join(DAK_TEST_FIXTURES, 'dak.conf')
+os.environ['DAK_CONFIG'] = fixture('dak.conf')
 
 if DAK_ROOT_DIR not in sys.path:
     sys.path.insert(0, DAK_ROOT_DIR)