From: Chris Lamb Date: Sat, 31 Oct 2009 15:39:46 +0000 (+0000) Subject: Add a 'fixture' utility to generate a path to a fixture. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0113a3259ee2c5395e61ee7939268c5d91d45ac4;p=dak Add a 'fixture' utility to generate a path to a fixture. Signed-off-by: Chris Lamb --- diff --git a/tests/base_test.py b/tests/base_test.py index 255e71b0..d99ce416 100644 --- a/tests/base_test.py +++ b/tests/base_test.py @@ -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)