Remove is_done property.

It is too similar to is_finished.
main
Vincent Driessen 13 years ago
parent bc7e32bae8
commit 6b0ebe9ceb

@ -103,10 +103,6 @@ class Job(object):
def is_failed(self): def is_failed(self):
return self.status == Status.FAILED return self.status == Status.FAILED
@property
def is_done(self):
return self._status is not None and not self.is_queued
@property @property
def func(self): def func(self):
func_name = self.func_name func_name = self.func_name

@ -181,7 +181,6 @@ class TestWorker(RQTestCase):
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)
self.assertEqual(job.is_done, False)
w.work(burst=True) w.work(burst=True)
job = Job.fetch(job.id) job = Job.fetch(job.id)
@ -189,7 +188,6 @@ class TestWorker(RQTestCase):
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)
self.assertEqual(job.is_done, True)
# Failed jobs should set status to "failed" # Failed jobs should set status to "failed"
job = q.enqueue(div_by_zero, args=(1,)) job = q.enqueue(div_by_zero, args=(1,))
@ -199,4 +197,3 @@ class TestWorker(RQTestCase):
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)
self.assertEqual(job.is_done, True)

Loading…
Cancel
Save