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_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.º 3
0
 def jobs(self):
     '''Yield only a few jobs'''
     generator = SerialWorker.jobs(self)
     for _ in range(5):
         yield next(generator)
Exemplo n.º 4
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.º 5
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')
Exemplo n.º 6
0
 def jobs(self):
     '''Yield only a few jobs'''
     generator = SerialWorker.jobs(self)
     for _ in range(5):
         yield next(generator)
Exemplo n.º 7
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.º 8
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')