diff --git a/rq/queue.py b/rq/queue.py index dbef8c09..e7f86bdf 100644 --- a/rq/queue.py +++ b/rq/queue.py @@ -72,8 +72,7 @@ class Queue(object): """Returns the Redis key for this Queue.""" return self._key - @property - def empty(self): + def is_empty(self): """Returns whether the current queue is empty.""" return self.count == 0 diff --git a/tests/test_queue.py b/tests/test_queue.py index c7cbc2e1..ff18e9e2 100644 --- a/tests/test_queue.py +++ b/tests/test_queue.py @@ -32,20 +32,20 @@ class TestQueue(RQTestCase): def test_queue_empty(self): """Detecting empty queues.""" q = Queue('my-queue') - self.assertEquals(q.empty, True) + self.assertEquals(q.is_empty(), True) self.testconn.rpush('rq:queue:my-queue', 'some val') - self.assertEquals(q.empty, False) + self.assertEquals(q.is_empty(), False) def test_enqueue(self): """Putting work on queues.""" q = Queue('my-queue') - self.assertEquals(q.empty, True) + self.assertEquals(q.is_empty(), True) # testjob spec holds which queue this is sent to q.enqueue(testjob, 'Nick', foo='bar') - self.assertEquals(q.empty, False) + self.assertEquals(q.is_empty(), False) self.assertQueueContains(q, testjob)