|
|
@ -214,14 +214,14 @@ class TestWorker(RQTestCase):
|
|
|
|
w = Worker([q])
|
|
|
|
w = Worker([q])
|
|
|
|
|
|
|
|
|
|
|
|
job = q.enqueue(say_hello)
|
|
|
|
job = q.enqueue(say_hello)
|
|
|
|
self.assertEqual(job.status, 'queued')
|
|
|
|
self.assertEqual(job.status, Status.QUEUED)
|
|
|
|
self.assertEqual(job.is_queued, True)
|
|
|
|
self.assertEqual(job.is_queued, True)
|
|
|
|
self.assertEqual(job.is_finished, False)
|
|
|
|
self.assertEqual(job.is_finished, False)
|
|
|
|
self.assertEqual(job.is_failed, False)
|
|
|
|
self.assertEqual(job.is_failed, False)
|
|
|
|
|
|
|
|
|
|
|
|
w.work(burst=True)
|
|
|
|
w.work(burst=True)
|
|
|
|
job = Job.fetch(job.id)
|
|
|
|
job = Job.fetch(job.id)
|
|
|
|
self.assertEqual(job.status, 'finished')
|
|
|
|
self.assertEqual(job.status, Status.FINISHED)
|
|
|
|
self.assertEqual(job.is_queued, False)
|
|
|
|
self.assertEqual(job.is_queued, False)
|
|
|
|
self.assertEqual(job.is_finished, True)
|
|
|
|
self.assertEqual(job.is_finished, True)
|
|
|
|
self.assertEqual(job.is_failed, False)
|
|
|
|
self.assertEqual(job.is_failed, False)
|
|
|
@ -230,7 +230,7 @@ class TestWorker(RQTestCase):
|
|
|
|
job = q.enqueue(div_by_zero, args=(1,))
|
|
|
|
job = q.enqueue(div_by_zero, args=(1,))
|
|
|
|
w.work(burst=True)
|
|
|
|
w.work(burst=True)
|
|
|
|
job = Job.fetch(job.id)
|
|
|
|
job = Job.fetch(job.id)
|
|
|
|
self.assertEqual(job.status, 'failed')
|
|
|
|
self.assertEqual(job.status, Status.FAILED)
|
|
|
|
self.assertEqual(job.is_queued, False)
|
|
|
|
self.assertEqual(job.is_queued, False)
|
|
|
|
self.assertEqual(job.is_finished, False)
|
|
|
|
self.assertEqual(job.is_finished, False)
|
|
|
|
self.assertEqual(job.is_failed, True)
|
|
|
|
self.assertEqual(job.is_failed, True)
|
|
|
@ -243,10 +243,10 @@ class TestWorker(RQTestCase):
|
|
|
|
job = q.enqueue_call(say_hello, depends_on=parent_job)
|
|
|
|
job = q.enqueue_call(say_hello, depends_on=parent_job)
|
|
|
|
w.work(burst=True)
|
|
|
|
w.work(burst=True)
|
|
|
|
job = Job.fetch(job.id)
|
|
|
|
job = Job.fetch(job.id)
|
|
|
|
self.assertEqual(job.status, 'finished')
|
|
|
|
self.assertEqual(job.status, Status.FINISHED)
|
|
|
|
|
|
|
|
|
|
|
|
parent_job = q.enqueue(div_by_zero)
|
|
|
|
parent_job = q.enqueue(div_by_zero)
|
|
|
|
job = q.enqueue_call(say_hello, depends_on=parent_job)
|
|
|
|
job = q.enqueue_call(say_hello, depends_on=parent_job)
|
|
|
|
w.work(burst=True)
|
|
|
|
w.work(burst=True)
|
|
|
|
job = Job.fetch(job.id)
|
|
|
|
job = Job.fetch(job.id)
|
|
|
|
self.assertNotEqual(job.status, 'finished')
|
|
|
|
self.assertNotEqual(job.status, Status.FINISHED)
|
|
|
|