]> git.decadent.org.uk Git - dak.git/blob - tests/base_test.py
dc606cc7feb8cca9ed6b259db65c84a2007f257b
[dak.git] / tests / base_test.py
1 import os
2 import sys
3 import unittest
4 import warnings
5
6 from os.path import abspath, dirname, join
7
8 DAK_ROOT_DIR = dirname(dirname(abspath(__file__)))
9
10 # suppress some deprecation warnings in squeeze related to apt_pkg,
11 # debian, and md5 modules
12 warnings.filterwarnings('ignore', \
13     "Attribute '.*' of the 'apt_pkg\.Configuration' object is deprecated, use '.*' instead\.", \
14     DeprecationWarning)
15 warnings.filterwarnings('ignore', \
16     "apt_pkg\.newConfiguration\(\) is deprecated\. Use apt_pkg\.Configuration\(\) instead\.", \
17     DeprecationWarning)
18 warnings.filterwarnings('ignore', \
19     "please use 'debian' instead of 'debian_bundle'", \
20     DeprecationWarning)
21 warnings.filterwarnings('ignore', \
22     "the md5 module is deprecated; use hashlib instead", \
23     DeprecationWarning)
24
25 class DakTestCase(unittest.TestCase):
26     def setUp(self):
27         pass
28
29 def fixture(*dirs):
30     return join(DAK_ROOT_DIR, 'tests', 'fixtures', *dirs)
31
32 os.environ['DAK_TEST'] = '1'
33 os.environ['DAK_CONFIG'] = fixture('dak.conf')
34
35 if DAK_ROOT_DIR not in sys.path:
36     sys.path.insert(0, DAK_ROOT_DIR)