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

This commit is contained in:
Vincent Driessen 2011-11-15 09:36:38 +01:00
parent 159eba6df2
commit 62b6b180f3
2 changed files with 3 additions and 3 deletions

View File

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

View File

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