@ -202,8 +202,9 @@ class TestWorker(RQTestCase):
q = Queue ( )
q = Queue ( )
w = Worker ( [ q ] )
w = Worker ( [ q ] )
w . register_birth ( )
w . register_birth ( )
birth = self . testconn . hget ( w . key , ' birth ' )
last_heartbeat = self . testconn . hget ( w . key , ' last_heartbeat ' )
last_heartbeat = self . testconn . hget ( w . key , ' last_heartbeat ' )
self . assertTrue ( birth is not None )
self . assertTrue ( last_heartbeat is not None )
self . assertTrue ( last_heartbeat is not None )
w = Worker . find_by_key ( w . key )
w = Worker . find_by_key ( w . key )
self . assertIsInstance ( w . last_heartbeat , datetime )
self . assertIsInstance ( w . last_heartbeat , datetime )
@ -212,6 +213,10 @@ class TestWorker(RQTestCase):
# for compatibility reasons
# for compatibility reasons
self . testconn . hdel ( w . key , ' last_heartbeat ' )
self . testconn . hdel ( w . key , ' last_heartbeat ' )
w . refresh ( )
w . refresh ( )
# worker.refresh() shouldn't fail if birth is None
# for compatibility reasons
self . testconn . hdel ( w . key , ' birth ' )
w . refresh ( )
def test_work_fails ( self ) :
def test_work_fails ( self ) :
""" Failing jobs are put on the failed queue. """
""" Failing jobs are put on the failed queue. """