test_imports.py 482 B

123456789101112131415161718192021
  1. #!/usr/bin/env python
  2. from base_test import DakTestCase, DAK_ROOT_DIR
  3. import glob
  4. import unittest
  5. from os.path import join, basename, splitext
  6. class ImportTestCase(DakTestCase):
  7. for filename in glob.glob(join(DAK_ROOT_DIR, 'dak', '*.py')):
  8. cmd, ext = splitext(basename(filename))
  9. def test_fn(self, cmd=cmd):
  10. __import__('dak', fromlist=[cmd])
  11. locals()['test_importing_%s' % cmd] = test_fn
  12. if __name__ == '__main__':
  13. unittest.main()