From fcca48a9d7525f74375e3554a0fb64ec20d06bdf Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 7 Feb 2012 20:53:06 +0100 Subject: [PATCH] Rename empty property -> is_empty() method. --- rq/queue.py | 3 +-- tests/test_queue.py | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/rq/queue.py b/rq/queue.py index dbef8c0..e7f86bd 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 c7cbc2e..ff18e9e 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)