Beispiel #1
0
    def __init__(self, channel_id, connection, rpc_timeout):
        super(Channel, self).__init__(channel_id)
        self.consumer_callback = None
        self.rpc = Rpc(self, timeout=rpc_timeout)
        self.message_build_timeout = rpc_timeout
        self._confirming_deliveries = False
        self._connection = connection
        self._inbound = []
        self._basic = Basic(self)
        self._exchange = Exchange(self)
        self._tx = Tx(self)
        self._queue = Queue(self)

        self._die = multiprocessing.Value("b", 0)
    def test_queue_delete_invalid_parameter(self):
        channel = Channel(0, FakeConnection(), 360)
        channel.set_state(Channel.OPEN)
        queue = Queue(channel)

        self.assertRaisesRegexp(exception.AMQPInvalidArgument,
                                'queue should be a string', queue.delete, None)

        self.assertRaisesRegexp(exception.AMQPInvalidArgument,
                                'if_unused should be a boolean', queue.delete,
                                '', None)

        self.assertRaisesRegexp(exception.AMQPInvalidArgument,
                                'if_empty should be a boolean', queue.delete,
                                '', True, None)
Beispiel #3
0
 def __init__(self,
              channel_id,
              connection,
              rpc_timeout,
              on_close_impl=None):
     super(Channel, self).__init__(channel_id)
     self.rpc = Rpc(self, timeout=rpc_timeout)
     self._consumer_callbacks = {}
     self._confirming_deliveries = False
     self._connection = connection
     self._on_close_impl = on_close_impl
     self._inbound = []
     self._basic = Basic(self, connection.max_frame_size)
     self._exchange = Exchange(self)
     self._tx = Tx(self)
     self._queue = Queue(self)
    def test_queue_unbind_invalid_parameter(self):
        channel = Channel(0, FakeConnection(), 360)
        channel.set_state(Channel.OPEN)
        queue = Queue(channel)

        self.assertRaisesRegexp(exception.AMQPInvalidArgument,
                                'queue should be a string', queue.unbind, None)

        self.assertRaisesRegexp(exception.AMQPInvalidArgument,
                                'exchange should be a string', queue.unbind,
                                '', None)

        self.assertRaisesRegexp(exception.AMQPInvalidArgument,
                                'routing_key should be a string', queue.unbind,
                                '', '', None)

        self.assertRaisesRegexp(exception.AMQPInvalidArgument,
                                'arguments should be a dict or None',
                                queue.unbind, '', '', '', [])