updates addressing @selwin comments for PR #465

main
Mark LaPerriere 10 years ago
parent a4ca4704ac
commit 636a537fa7

@ -249,14 +249,14 @@ class Worker(object):
def birth_date(self): def birth_date(self):
"""Fetches birth date from Redis.""" """Fetches birth date from Redis."""
birth_timestamp = self.connection.hget(self.key, 'birth') birth_timestamp = self.connection.hget(self.key, 'birth')
if birth_timestamp: if birth_timestamp is not None:
return utcparse(as_text(birth_timestamp)) return utcparse(as_text(birth_timestamp))
@property @property
def death_date(self): def death_date(self):
"""Fetches death date from Redis.""" """Fetches death date from Redis."""
death_timestamp = self.connection.hget(self.key, 'death') death_timestamp = self.connection.hget(self.key, 'death')
if death_timestamp: if death_timestamp is not None:
return utcparse(as_text(death_timestamp)) return utcparse(as_text(death_timestamp))

@ -392,7 +392,7 @@ class TestWorker(RQTestCase):
self.assertEquals(type(birth_date).__name__, 'datetime') self.assertEquals(type(birth_date).__name__, 'datetime')
def test_worker_sets_death(self): def test_worker_sets_death(self):
"""Ensure worker correctly sets worker birth date.""" """Ensure worker correctly sets worker death date."""
q = Queue() q = Queue()
w = Worker([q]) w = Worker([q])

Loading…
Cancel
Save