ui: refine the 'compare commits' dialog
[git-cola.git] / t / t0000-import-test.py
blobdca56c64dde56d62cd529bc958d06742db2cb862
1 #!/usr/bin/env python
2 import os
3 import imp
4 import unittest
6 from testutils import *
7 from testmodel import *
9 class ImportTest(TestCase):
10 pass
12 def gen_import_test(module):
13 def import_test(self):
14 modinfo = None
15 for idx, path in enumerate(module.split('.')):
16 if idx == 0:
17 modinfo = imp.find_module(path)
18 mod = imp.load_module(module, *modinfo)
19 else:
20 modinfo = imp.find_module('cola/'+path, modinfo[0])
21 mod = imp.load_module(path, *modinfo)
22 self.failUnless(mod)
23 return import_test
25 def setup_tests():
26 for module in """
27 cola.git
28 cola.model
29 cola.observer
30 cola.exception
31 cola.defaults
32 cola.settings
33 """.split():
34 setattr(ImportTest,
35 "test" + module.title().replace('.', ''),
36 gen_import_test(module))
38 setup_tests()
39 unittest.main()