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