Ejemplo n.º 1
0
 def test_setup_queues_worker_direct(self):
     self.app.conf.worker_direct = True
     self.app.amqp.__dict__['queues'] = Mock()
     self.worker.setup_queues({})
     self.app.amqp.queues.select_add.assert_called_with(
         worker_direct(self.worker.hostname),
     )
Ejemplo n.º 2
0
 def test_setup_queues_worker_direct(self):
     self.app.conf.worker_direct = True
     self.app.amqp.__dict__['queues'] = Mock()
     self.worker.setup_queues({})
     self.app.amqp.queues.select_add.assert_called_with(
         worker_direct(self.worker.hostname),
     )
Ejemplo n.º 3
0
 def setup_queues(self, include, exclude=None):
     include = str_to_list(include)
     exclude = str_to_list(exclude)
     try:
         self.app.amqp.queues.select(include)
     except KeyError as exc:
         raise ImproperlyConfigured(
             SELECT_UNKNOWN_QUEUE.strip().format(include, exc))
     try:
         self.app.amqp.queues.deselect(exclude)
     except KeyError as exc:
         raise ImproperlyConfigured(
             DESELECT_UNKNOWN_QUEUE.strip().format(exclude, exc))
     if self.app.conf.worker_direct:
         self.app.amqp.queues.select_add(worker_direct(self.hostname))
Ejemplo n.º 4
0
 def setup_queues(self, include, exclude=None):
     include = str_to_list(include)
     exclude = str_to_list(exclude)
     try:
         self.app.amqp.queues.select(include)
     except KeyError as exc:
         raise ImproperlyConfigured(
             SELECT_UNKNOWN_QUEUE.strip().format(include, exc))
     try:
         self.app.amqp.queues.deselect(exclude)
     except KeyError as exc:
         raise ImproperlyConfigured(
             DESELECT_UNKNOWN_QUEUE.strip().format(exclude, exc))
     if self.app.conf.worker_direct:
         self.app.amqp.queues.select_add(worker_direct(self.hostname))
Ejemplo n.º 5
0
 def test_returns_if_queue(self):
     q = Queue('foo')
     assert worker_direct(q) is q
Ejemplo n.º 6
0
 def test_returns_if_queue(self):
     q = Queue('foo')
     self.assertIs(worker_direct(q), q)
 def test_returns_if_queue(self):
     q = Queue('foo')
     self.assertIs(worker_direct(q), q)
Ejemplo n.º 8
0
 def test_returns_if_queue(self):
     q = Queue('foo')
     assert worker_direct(q) is q