Пример #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()
Пример #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()
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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()