test_foo.py 944 B

123456789101112131415161718192021222324252627282930313233343536
  1. import os, unittest
  2. from falcon_kit.util.io import system
  3. # Also in pbcommand/testkit/base_utils.py
  4. def pb_requirements(*reqs):
  5. """
  6. Method decorator for specifying linked JIRA issues.
  7. """
  8. def decorator(test_item):
  9. test_item.__pb_requirements__ = list(reqs)
  10. return test_item
  11. return decorator
  12. class TestBase(unittest.TestCase):
  13. _is_test = True
  14. job_dir = None
  15. service_access_layer = None
  16. job_id = None
  17. @unittest.skip('FOO')
  18. class TestMe(TestBase):
  19. @unittest.skip('would fail')
  20. def test_excfunc(self):
  21. raise Exception('FAIL HERE')
  22. @unittest.skip('would fail')
  23. def test_assertfunc(self):
  24. assert 0 > 1, 'no way'
  25. @unittest.skip('would fail')
  26. def test_failfunc(self):
  27. msg = 'In {} dir'.format(self.job_dir)
  28. self.fail(msg)
  29. def test_goodfunc(self):
  30. pass
  31. @pb_requirements('TAGT-000')
  32. def test_myprd_func(self):
  33. pass