def test_normal_run(self): thread = impl_eventlet.spawn_with(self.mgr, pool=eventlet) thread.wait() self.assertEqual(1, self.before.call_count) self.assertEqual(1, self.callback.call_count) self.assertEqual(1, self.after.call_count) self.assertEqual(0, self.exception_call.call_count)
def test_unexcepted_exception(self): self.callback.side_effect = Exception thread = impl_eventlet.spawn_with(self.mgr, pool=eventlet) try: thread.wait() except Exception: pass self.assertEqual(1, self.before.call_count) self.assertEqual(1, self.callback.call_count) self.assertEqual(0, self.after.call_count) self.assertEqual(0, self.exception_call.call_count)
def _dispatch(self, incoming): ctx = self.dispatcher(incoming, self._coroutine_wrapper) impl_eventlet.spawn_with(ctxt=ctx, pool=self._greenpool)