From 636a537fa7bb4fe31e3c5e30d79e2dfe4a460e45 Mon Sep 17 00:00:00 2001 From: Mark LaPerriere Date: Thu, 26 Feb 2015 09:41:20 -0500 Subject: [PATCH] updates addressing @selwin comments for PR #465 --- rq/worker.py | 4 ++-- tests/test_worker.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rq/worker.py b/rq/worker.py index 6c351c8..a32c6d9 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -249,14 +249,14 @@ class Worker(object): def birth_date(self): """Fetches birth date from Redis.""" birth_timestamp = self.connection.hget(self.key, 'birth') - if birth_timestamp: + if birth_timestamp is not None: return utcparse(as_text(birth_timestamp)) @property def death_date(self): """Fetches death date from Redis.""" death_timestamp = self.connection.hget(self.key, 'death') - if death_timestamp: + if death_timestamp is not None: return utcparse(as_text(death_timestamp)) diff --git a/tests/test_worker.py b/tests/test_worker.py index 65edead..6f89f4a 100644 --- a/tests/test_worker.py +++ b/tests/test_worker.py @@ -392,7 +392,7 @@ class TestWorker(RQTestCase): self.assertEquals(type(birth_date).__name__, 'datetime') def test_worker_sets_death(self): - """Ensure worker correctly sets worker birth date.""" + """Ensure worker correctly sets worker death date.""" q = Queue() w = Worker([q])