-
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 10, 2024
1 parent
1ffb97a
commit 9e7bec5
Showing
7 changed files
with
86 additions
and
89 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
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
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,44 @@ | ||
from rabbitmq_amqp_python_client import ( | ||
Connection, | ||
ExchangeSpecification, | ||
QueueSpecification, | ||
QueueType, | ||
) | ||
|
||
|
||
def test_declare_delete_exchange() -> None: | ||
connection = Connection("amqp://guest:guest@localhost:5672/") | ||
connection.dial() | ||
|
||
exchange_name = "test-exchange" | ||
management = connection.management() | ||
|
||
exchange_info = management.declare_exchange( | ||
ExchangeSpecification(name=exchange_name, arguments={}) | ||
) | ||
|
||
assert exchange_info.name == exchange_name | ||
|
||
# Still not working | ||
# management.delete_exchange(exchange_name) | ||
|
||
connection.close() | ||
|
||
|
||
def test_declare_delete_queue() -> None: | ||
connection = Connection("amqp://guest:guest@localhost:5672/") | ||
connection.dial() | ||
|
||
queue_name = "test-queue" | ||
management = connection.management() | ||
|
||
exchange_info = management.declare_queue( | ||
QueueSpecification(name=queue_name, queue_type=QueueType.quorum, arguments={}) | ||
) | ||
|
||
assert exchange_info.name == queue_name | ||
|
||
# Still not working | ||
# management.delete_queue(queue_name) | ||
|
||
connection.close() |