Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(28)  |  Call(24)  |  Derive(0)  |  Import(4)
Queue name? declaration mapping.

:param queues: Initial list/tuple or dict of queues.
:keyword create_missing: By default any unknown queues will be
                         added automatically, but if disabled
                         the occurrence of unknown queues
                         in `wanted` will raise :exc:`KeyError`.
:keyword ha_policy: Default HA policy for queues with none set.

src/c/e/celery-3.1.11/celery/tests/app/test_amqp.py   celery(Download)
from kombu import Exchange, Queue
 
from celery.app.amqp import Queues, TaskPublisher
from celery.five import keys
from celery.tests.case import AppCase, Mock
    def test_add(self):
        q = Queues()
        q.add('foo', exchange='ex', routing_key='rk')
        self.assertIn('foo', q)
        self.assertIsInstance(q['foo'], Queue)
        self.assertEqual(q['foo'].routing_key, 'rk')
 
    def test_with_ha_policy(self):
        qn = Queues(ha_policy=None, create_missing=False)
        self.assertEqual(qn['xyx'].queue_arguments, {'x-foo': 'bar'})
 
        q = Queues(ha_policy='all', create_missing=False)
        q.add(Queue('foo'))
        self.assertEqual(q['foo'].queue_arguments, {'x-ha-policy': 'all'})
        })
 
        q2 = Queues(ha_policy=['A', 'B', 'C'], create_missing=False)
        q2.add(Queue('foo'))
        self.assertEqual(q2['foo'].queue_arguments, {

src/c/e/celery-HEAD/celery/tests/app/test_amqp.py   celery(Download)
from __future__ import absolute_import
 
from kombu import Exchange, Queue
 
from celery.app.amqp import Queues
    def test_add(self):
        q = Queues()
        q.add('foo', exchange='ex', routing_key='rk')
        self.assertIn('foo', q)
        self.assertIsInstance(q['foo'], Queue)
        self.assertEqual(q['foo'].routing_key, 'rk')
 
    def test_with_ha_policy(self):
        qn = Queues(ha_policy=None, create_missing=False)
        self.assertEqual(qn['xyx'].queue_arguments, {'x-foo': 'bar'})
 
        q = Queues(ha_policy='all', create_missing=False)
        q.add(Queue('foo'))
        self.assertEqual(q['foo'].queue_arguments, {'x-ha-policy': 'all'})
        })
 
        q2 = Queues(ha_policy=['A', 'B', 'C'], create_missing=False)
        q2.add(Queue('foo'))
        self.assertEqual(q2['foo'].queue_arguments, {

src/a/n/antisocial-HEAD/ve/lib/python2.7/site-packages/celery/tests/app/test_amqp.py   antisocial(Download)
from mock import Mock
 
from celery.app.amqp import Queues, TaskPublisher
from celery.tests.utils import AppCase
 
    def test_add(self):
        q = Queues()
        q.add('foo', exchange='ex', routing_key='rk')
        self.assertIn('foo', q)
        self.assertIsInstance(q['foo'], Queue)
        self.assertEqual(q['foo'].routing_key, 'rk')
 
    def test_add_default_exchange(self):
        ex = Exchange('fff', 'fanout')
        q = Queues(default_exchange=ex)
    def test_alias(self):
        q = Queues()
        q.add(Queue('foo', alias='barfoo'))
        self.assertIs(q['barfoo'], q['foo'])
 

src/f/i/firefox-flicks-HEAD/vendor-local/lib/python/celery/tests/app/test_amqp.py   firefox-flicks(Download)
from mock import Mock
 
from celery.app.amqp import Queues, TaskPublisher
from celery.tests.utils import AppCase
 
    def test_add(self):
        q = Queues()
        q.add('foo', exchange='ex', routing_key='rk')
        self.assertIn('foo', q)
        self.assertIsInstance(q['foo'], Queue)
        self.assertEqual(q['foo'].routing_key, 'rk')
 
    def test_add_default_exchange(self):
        ex = Exchange('fff', 'fanout')
        q = Queues(default_exchange=ex)
    def test_alias(self):
        q = Queues()
        q.add(Queue('foo', alias='barfoo'))
        self.assertIs(q['barfoo'], q['foo'])