File tree Expand file tree Collapse file tree 3 files changed +36
-2
lines changed
rabbitmq_amqp_python_client Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 1- from proton import Message
2-
31from rabbitmq_amqp_python_client import (
42 BindingSpecification ,
53 Connection ,
64 ExchangeSpecification ,
5+ Message ,
76 QueueSpecification ,
87 QueueType ,
98 exchange_address ,
Original file line number Diff line number Diff line change 11from importlib import metadata
22
3+ from proton import Message
4+
35from .address_helper import exchange_address
46from .common import QueueType
57from .connection import Connection
2729 "QueueType" ,
2830 "Publisher" ,
2931 "exchange_address" ,
32+ "Message" ,
3033]
Original file line number Diff line number Diff line change 1+ from rabbitmq_amqp_python_client import (
2+ Connection ,
3+ Message ,
4+ QueueSpecification ,
5+ QueueType ,
6+ )
7+
8+
9+ def test_bind_exchange_to_queue () -> None :
10+ connection = Connection ("amqp://guest:guest@localhost:5672/" )
11+ connection .dial ()
12+
13+ queue_name = "test-queue"
14+ management = connection .management ()
15+
16+ management .declare_queue (
17+ QueueSpecification (name = queue_name , queue_type = QueueType .quorum , arguments = {})
18+ )
19+
20+ raised = False
21+
22+ try :
23+ publisher = connection .publisher ("/queues/" + queue_name )
24+ publisher .publish (Message (body = "test" ))
25+ except Exception :
26+ raised = True
27+
28+ assert raised is False
29+
30+ publisher .close ()
31+ # Still not working
32+ # management.delete_queue(queue_name)
You can’t perform that action at this time.
0 commit comments