Browse Source

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

Mukund Sivaraman 11 years ago
parent
commit
4cfee008f5
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/lib/python/isc/util/tests/traceback_handler_test.py

+ 6 - 0
src/lib/python/isc/util/tests/traceback_handler_test.py

@@ -42,21 +42,27 @@ class TracebackHandlerTest(unittest.TestCase):
         Test the handler doesn't influence the result of successful
         function.
         """
+        self.called = False
         def succ():
+            self.called = True
             return 42
 
         self.assertEqual(42,
                          isc.util.traceback_handler.traceback_handler(succ))
+        self.assertTrue(self.called)
 
     def test_success_no_returned_value(self):
         """
         Test the handler handles the case where main() returns nothing.
         """
+        self.called = False
         def succ():
+            self.called = True
             return
 
         self.assertEqual(None,
                          isc.util.traceback_handler.traceback_handler(succ))
+        self.assertTrue(self.called)
 
     def test_exception(self):
         """