Exemplo n.º 1
0
 def test_kill(self):
     '''Should be able to fall on its sword if need be'''
     worker = SerialWorker([], self.client)
     worker.jid = 'foo'
     thread = Thread(target=worker.kill, args=(worker.jid, ))
     thread.start()
     thread.join()
     self.assertFalse(thread.is_alive())
Exemplo n.º 2
0
 def test_shutdown(self):
     '''We should be able to shutdown a serial worker'''
     # If this test finishes, it passes
     worker = SerialWorker([], self.client, interval=0.1)
     worker.stop()
     worker.run()
Exemplo n.º 3
0
 def test_kill_dead(self):
     '''If we've moved on to another job, say so'''
     # If this tests runs to completion, it has succeeded
     worker = SerialWorker([], self.client)
     worker.kill('foo')