Commits
37 37 | UNEXISTS = 'unexists' |
38 38 | DUMMY_FOLDERS = ('dummy1', 'dummy2', 'dummy3') |
39 39 | |
40 40 | casalog.origin('imbaseline') |
41 41 | |
42 42 | |
43 43 | class test_base(unittest.TestCase): |
44 44 | |
45 45 | |
46 46 | def exception_case(exception_type, exception_pattern): |
47 - | """Decorator for the test case that is intended to throw exception. |
47 + | """Decorator for tests intended to throw a specific exception. |
48 48 | |
49 49 | exception_type: type of exception |
50 50 | exception_pattern: regex for inspecting exception message |
51 51 | using re.search |
52 52 | """ |
53 53 | def wrapper(func): |
54 54 | wraps(func) | .
55 55 | def _wrapper(self): |
56 56 | self.assertTrue(len(exception_pattern) > 0, msg='Internal Error') |
57 57 | with self.assertRaises(exception_type) as ctx: |