Exemplo n.º 1
0
    def test_close_does_delete_if_anonymous_and_not_auto_delete(self):
        transport = AMQPTransport(Mock())
        ch = SubscriberChannel()
        ch.on_channel_open(transport)
        ch._queue_auto_delete = False
        ch._destroy_queue = Mock()
        ch._recv_name = NameTrio(sentinel.exchange, 'amq.gen-ABCD')

        ch.close_impl()
        ch._destroy_queue.assert_called_once_with()
Exemplo n.º 2
0
    def test_close_does_delete_if_anonymous_and_not_auto_delete(self):
        transport = AMQPTransport(Mock())
        ch = SubscriberChannel()
        ch.on_channel_open(transport)
        ch._queue_auto_delete = False
        ch._destroy_queue = Mock()
        ch._recv_name = NameTrio(sentinel.exchange, 'amq.gen-ABCD')

        ch.close_impl()
        ch._destroy_queue.assert_called_once_with()
Exemplo n.º 3
0
    def test_close_does_not_delete_if_anon_but_auto_delete(self):
        ch = SubscriberChannel()
        ch._queue_auto_delete = True
        ch._destroy_queue = Mock()
        ch._recv_name = NameTrio(sentinel.exchange, 'amq.gen-ABCD')

        ch.close_impl()
        self.assertFalse(ch._destroy_queue.called)
Exemplo n.º 4
0
    def test_close_does_not_delete_if_named(self):
        ch = SubscriberChannel()
        ch._queue_auto_delete = False
        ch._destroy_queue = Mock()
        ch._recv_name = NameTrio(sentinel.exchange, 'some-named-queue')

        ch.close_impl()
        self.assertFalse(ch._destroy_queue.called)
Exemplo n.º 5
0
    def test_close_does_not_delete_if_anon_but_auto_delete(self):
        ch = SubscriberChannel()
        ch._queue_auto_delete = True
        ch._destroy_queue = Mock()
        ch._recv_name = NameTrio(sentinel.exchange, 'amq.gen-ABCD')

        ch.close_impl()
        self.assertFalse(ch._destroy_queue.called)
Exemplo n.º 6
0
    def test_close_does_not_delete_if_named(self):
        ch = SubscriberChannel()
        ch._queue_auto_delete = False
        ch._destroy_queue = Mock()
        ch._recv_name = NameTrio(sentinel.exchange, 'some-named-queue')

        ch.close_impl()
        self.assertFalse(ch._destroy_queue.called)
Exemplo n.º 7
0
    def test_close_does_delete_if_anonymous_and_not_auto_delete(self):
        ch = SubscriberChannel()
        ch._queue_auto_delete = False
        ch._destroy_queue = Mock()
        ch._recv_name = NameTrio(sentinel.exchange, "amq.gen-ABCD")

        ch.close_impl()
        ch._destroy_queue.assert_called_once_with()