Also allow args and kwargs to enqueue() calls on Queue.

main
Vincent Driessen 13 years ago
parent 159eba6df2
commit 62b6b180f3

@ -28,8 +28,8 @@ class Queue(object):
def count(self): def count(self):
return conn.llen(self.key) return conn.llen(self.key)
def enqueue(self, job): def enqueue(self, job, *args, **kwargs):
return job.enqueue(self) return job.enqueue(self, *args, **kwargs)
def dequeue(self): def dequeue(self):
s = conn.lpop(self.key) s = conn.lpop(self.key)

@ -157,7 +157,7 @@ class TestJob(RQTestCase):
q = Queue('alt-queue') q = Queue('alt-queue')
self.assertEquals(q.empty, True) self.assertEquals(q.empty, True)
q.enqueue(testjob) q.enqueue(testjob, 'Simon')
self.assertEquals(q.empty, False) self.assertEquals(q.empty, False)
self.assertQueueContains(q, testjob) self.assertQueueContains(q, testjob)

Loading…
Cancel
Save