From 4eda2e7d9edd5c87541a8032136b9d96e17ff3e2 Mon Sep 17 00:00:00 2001 From: Daniele Palaia Date: Wed, 26 Mar 2025 14:05:46 +0100 Subject: [PATCH] 0.1.0-beta.2 --- pyproject.toml | 2 +- tests/test_connection.py | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2a28892..736f656 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "rabbitmq-amqp-python-client" -version = "0.1.0-beta.1" +version = "0.1.0-beta.2" description = "Python RabbitMQ client for AMQP 1.0 protocol" authors = ["RabbitMQ team"] license = "Apache-2.0 license" diff --git a/tests/test_connection.py b/tests/test_connection.py index 10f933b..6190761 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -95,6 +95,29 @@ def test_connection_oauth_refresh_token(environment_auth: Environment) -> None: connection.close() +def test_connection_oauth_refresh_token_with_disconnection( + environment_auth: Environment, +) -> None: + + connection = environment_auth.connection() + connection.dial() + # let the token expire + time.sleep(1) + raised = False + # generate new token + connection.refresh_token(token(datetime.now() + timedelta(milliseconds=5000))) + delete_all_connections() + time.sleep(3) + try: + management = connection.management() + management.declare_queue(QuorumQueueSpecification(name="test-queue")) + except Exception: + raised = True + + assert raised is False + connection.close() + + def test_environment_connections_management() -> None: environment = Environment(uri="amqp://guest:guest@localhost:5672/")