Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. #!/usr/bin/python -E
  2. import unittest
  3. import os
  4. import sys
  5.  
  6. class TestSequense(unittest.TestCase):
  7.     pass
  8.  
  9. def test_dir_exists(dir):
  10.     def test(self):
  11.         try:
  12.             self.assertTrue(os.path.isdir(dir),"ERROR: " + dir + " is not a directory")
  13.         except Exception as e:
  14.             print(e)
  15.     return test
  16.  
  17. if __name__ == '__main__':
  18.     test = test_dir_exists("/something/not/set/correctly")
  19.     setattr(TestSequense, "test_path",  test)
  20.     #TODO trying remove unnecessary traceback info... still not working
  21.     sys.tracebacklimit = 0
  22.     unittest.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement