コード例 #1
0
ファイル: channel.py プロジェクト: woebbi/ReadableWebProxy
    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)
コード例 #2
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)
コード例 #3
0
ファイル: channel.py プロジェクト: tkram01/amqpstorm
 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)
コード例 #4
0
    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, '', '', '', [])