add a crude check for a custom exception message in the test suite

This commit is contained in:
Ray Holder 2014-05-04 20:37:32 -05:00
parent 389d407f9d
commit b95ae91b11
1 changed files with 4 additions and 1 deletions

View File

@ -193,7 +193,8 @@ class NoCustomErrorAfterCount:
"""
if self.counter < self.count:
self.counter += 1
raise CustomError("This is a Custom exception class")
derived_message = "This is a Custom exception class"
raise CustomError(derived_message)
return True
def retry_if_result_none(result):
@ -370,6 +371,8 @@ class TestDecoratorWrapper(unittest.TestCase):
self.assertTrue(re.last_attempt.value[0] is not None)
self.assertTrue(isinstance(re.last_attempt.value[1], CustomError))
self.assertTrue(re.last_attempt.value[2] is not None)
self.assertTrue("This is a Custom exception class" in str(re.last_attempt.value[1]))
print(re)
def test_defaults(self):