test_imports.py 515 B

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