Skip to content

Commit b1aad0f

Browse files
0.1.0-beta.2 (#59)
1 parent 2317658 commit b1aad0f

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "rabbitmq-amqp-python-client"
3-
version = "0.1.0-beta.1"
3+
version = "0.1.0-beta.2"
44
description = "Python RabbitMQ client for AMQP 1.0 protocol"
55
authors = ["RabbitMQ team"]
66
license = "Apache-2.0 license"

tests/test_connection.py

+23
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,29 @@ def test_connection_oauth_refresh_token(environment_auth: Environment) -> None:
9595
connection.close()
9696

9797

98+
def test_connection_oauth_refresh_token_with_disconnection(
99+
environment_auth: Environment,
100+
) -> None:
101+
102+
connection = environment_auth.connection()
103+
connection.dial()
104+
# let the token expire
105+
time.sleep(1)
106+
raised = False
107+
# generate new token
108+
connection.refresh_token(token(datetime.now() + timedelta(milliseconds=5000)))
109+
delete_all_connections()
110+
time.sleep(3)
111+
try:
112+
management = connection.management()
113+
management.declare_queue(QuorumQueueSpecification(name="test-queue"))
114+
except Exception:
115+
raised = True
116+
117+
assert raised is False
118+
connection.close()
119+
120+
98121
def test_environment_connections_management() -> None:
99122

100123
environment = Environment(uri="amqp://guest:guest@localhost:5672/")

0 commit comments

Comments
 (0)