-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
DanielePalaia
committed
Dec 13, 2024
1 parent
25ad6c6
commit 9b2b601
Showing
3 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from rabbitmq_amqp_python_client import ( | ||
Connection, | ||
Message, | ||
QueueSpecification, | ||
QueueType, | ||
) | ||
|
||
|
||
def test_bind_exchange_to_queue() -> None: | ||
connection = Connection("amqp://guest:guest@localhost:5672/") | ||
connection.dial() | ||
|
||
queue_name = "test-queue" | ||
management = connection.management() | ||
|
||
management.declare_queue( | ||
QueueSpecification(name=queue_name, queue_type=QueueType.quorum, arguments={}) | ||
) | ||
|
||
raised = False | ||
|
||
try: | ||
publisher = connection.publisher("/queues/" + queue_name) | ||
publisher.publish(Message(body="test")) | ||
except Exception: | ||
raised = True | ||
|
||
assert raised is False | ||
|
||
publisher.close() | ||
# Still not working | ||
# management.delete_queue(queue_name) |