Exemplo n.º 1
0
 def test_2stage(self):
     t = Pipeline.n(self.doubler.n(), self.doubler.n())
     t.start(2)
     self._handle_messages()
     t.refresh()
     self.assertEqual(M.Message.m.find().count(), 0)
     self.assertEqual(M.TaskState.m.find().count(), 1)
     self.assertEqual(t.result.get(), 8)
Exemplo n.º 2
0
 def test_2stage(self):
     t = Pipeline.n(
         self.doubler.n(),
         self.doubler.n())
     t.start(2)
     self._handle_messages()
     t.refresh()
     self.assertEqual(M.Message.m.find().count(), 0)
     self.assertEqual(M.TaskState.m.find().count(), 1)
     self.assertEqual(t.result.get(), 8)
Exemplo n.º 3
0
 def test_2stage_err(self):
     t = Pipeline.n(self.doubler.n(), self.doubler.n())
     t.start(None)
     self._handle_messages()
     t.refresh()
     self.assertEqual(M.Message.m.find().count(), 0)
     self.assertEqual(M.TaskState.m.find().count(), 1)
     with self.assertRaises(exc.TaskError) as err:
         t.result.get()
     self.assertEqual(err.exception.args[0], TypeError)
Exemplo n.º 4
0
 def test_2stage_err(self):
     t = Pipeline.n(
         self.doubler.n(),
         self.doubler.n())
     t.start(None)
     self._handle_messages()
     t.refresh()
     self.assertEqual(M.Message.m.find().count(), 0)
     self.assertEqual(M.TaskState.m.find().count(), 1)
     with self.assertRaises(exc.TaskError) as err:
         t.result.get()
     self.assertEqual(err.exception.args[0], TypeError)