Commit 4cfee008 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[3095] Assert that the main() function is called when passed to the traceback handler

parent b1274061
...@@ -42,21 +42,27 @@ class TracebackHandlerTest(unittest.TestCase): ...@@ -42,21 +42,27 @@ class TracebackHandlerTest(unittest.TestCase):
Test the handler doesn't influence the result of successful Test the handler doesn't influence the result of successful
function. function.
""" """
self.called = False
def succ(): def succ():
self.called = True
return 42 return 42
self.assertEqual(42, self.assertEqual(42,
isc.util.traceback_handler.traceback_handler(succ)) isc.util.traceback_handler.traceback_handler(succ))
self.assertTrue(self.called)
def test_success_no_returned_value(self): def test_success_no_returned_value(self):
""" """
Test the handler handles the case where main() returns nothing. Test the handler handles the case where main() returns nothing.
""" """
self.called = False
def succ(): def succ():
self.called = True
return return
self.assertEqual(None, self.assertEqual(None,
isc.util.traceback_handler.traceback_handler(succ)) isc.util.traceback_handler.traceback_handler(succ))
self.assertTrue(self.called)
def test_exception(self): def test_exception(self):
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment