Exemplo n.º 1
0
class DescribeCreateBindings(_BaseTestCase):

    def configure(self):
        self.bindings = (
            {
                'queue': sentinel.queue1,
                'exchange': sentinel.exchange1,
                'routing_key': sentinel.routing_key1,
            },
            {
                'queue': sentinel.queue2,
                'exchange': sentinel.exchange2,
                'routing_key': sentinel.routing_key2,
            },
        )
        self.agent = ConsumerAgent(sentinel.consumer, sentinel.broker,
                                   self.bindings)
        self.agent.create_binding = MagicMock()

    def execute(self):
        self.agent.create_bindings()

    def should_create_each_individual_binding(self):
        self.assertEqual(self.agent.create_binding.mock_calls,
                         [call(**binding) for binding in self.bindings])
Exemplo n.º 2
0
class DescribeCreateBindings(_BaseTestCase):
    def configure(self):
        self.bindings = (
            {
                'queue': sentinel.queue1,
                'exchange': sentinel.exchange1,
                'routing_key': sentinel.routing_key1,
            },
            {
                'queue': sentinel.queue2,
                'exchange': sentinel.exchange2,
                'routing_key': sentinel.routing_key2,
            },
        )
        self.agent = ConsumerAgent(sentinel.consumer, sentinel.broker,
                                   self.bindings)
        self.agent.create_binding = MagicMock()

    def execute(self):
        self.agent.create_bindings()

    def should_create_each_individual_binding(self):
        self.assertEqual(self.agent.create_binding.mock_calls,
                         [call(**binding) for binding in self.bindings])