Example #1
0
 def test_finish_exception(self, mock_logger):
     """Assert that if ``finish`` raises a RuntimeError, it's logged."""
     responder = Responder(Mock())
     responder.request.finish.side_effect = RuntimeError('Womp womp')
     responder.finish()
     responder.request.finish.assert_called_once_with()
     mock_logger.debug.assert_called_once_with('Womp womp')
Example #2
0
 def test_finish(self):
     """Assert the ``finish`` method is called by its wrapper"""
     responder = Responder(Mock())
     responder.finish()
     responder.request.finish.assert_called_once_with()