예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 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)
예제 #5
0
 def _dispatch(self, incoming):
     ctx = self.dispatcher(incoming, self._coroutine_wrapper)
     impl_eventlet.spawn_with(ctxt=ctx, pool=self._greenpool)