Example #1
0
    def test_utc(self):

        d1 = timezone.now()
        d2 = timezone.now() + datetime.timedelta(minutes=1)

        task1 = test_task.schedule(eta=timezone.localtime(d1).replace(
            tzinfo=None))
        task2 = test_task.schedule(eta=timezone.localtime(d2).replace(
            tzinfo=None))

        sleep(5)

        result1 = huey.get_storage().peek_data(task1.task.task_id)
        if result1 is not EmptyData:
            result1 = pickle.loads(result1)

        result2 = huey.get_storage().peek_data(task2.task.task_id)
        if result2 is not EmptyData:
            result2 = pickle.loads(result2)

        self.assertNotEqual(result1, result2)
Example #2
0
 def _check_redis_connection(self):
     """
     Runs the redis ECHO command to check connection
     """
     HUEY.get_storage().conn.echo('health_check')