You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rq/tests/test_fixtures.py

21 lines
685 B
Python

# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from rq import Queue
from tests import RQTestCase, fixtures
class TestFixtures(RQTestCase):
def test_rpush_fixture(self):
fixtures.rpush('foo', 'bar')
assert self.testconn.lrange('foo', 0, 0)[0].decode() == 'bar'
def test_start_worker_fixture(self):
queue = Queue(name='testing', connection=self.testconn)
queue.enqueue(fixtures.say_hello)
conn_kwargs = self.testconn.connection_pool.connection_kwargs
fixtures.start_worker(queue.name, conn_kwargs, 'w1', True)
assert not queue.jobs