From 0113a3259ee2c5395e61ee7939268c5d91d45ac4 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Sat, 31 Oct 2009 15:39:46 +0000 Subject: [PATCH] Add a 'fixture' utility to generate a path to a fixture. Signed-off-by: Chris Lamb --- tests/base_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) -- 2.39.5