Skip to content

Commit 0b8fb2e

Browse files
committed
add tests for async management
1 parent 9510cf1 commit 0b8fb2e

File tree

2 files changed

+549
-2
lines changed

2 files changed

+549
-2
lines changed

tests/asyncio/fixtures.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
PosixSslConfigurationContext,
1111
RecoveryConfiguration,
1212
WinSslConfigurationContext,
13+
AsyncManagement,
1314
)
1415

1516
from ..utils import token
1617

1718

1819
@pytest_asyncio.fixture
1920
async def async_environment():
20-
"""Fixture for async environment."""
2121
environment = AsyncEnvironment(uri="amqp://guest:guest@localhost:5672/")
2222
yield environment
2323
await environment.close()
@@ -47,7 +47,6 @@ async def async_connection() -> AsyncGenerator[AsyncConnection, None]:
4747

4848
@pytest_asyncio.fixture
4949
async def async_connection_with_reconnect() -> AsyncGenerator[AsyncConnection, None]:
50-
"""Fixture providing an async connection with recovery enabled."""
5150
environment = AsyncEnvironment(
5251
uri="amqp://guest:guest@localhost:5672/",
5352
recovery_configuration=RecoveryConfiguration(active_recovery=True),
@@ -70,3 +69,13 @@ async def async_connection_ssl(
7069
await connection.dial()
7170
yield connection
7271
await connection.close()
72+
73+
74+
@pytest_asyncio.fixture
75+
async def async_management() -> AsyncGenerator[AsyncManagement, None]:
76+
environment = AsyncEnvironment(uri="amqp://guest:guest@localhost:5672/")
77+
connection = await environment.connection()
78+
await connection.dial()
79+
management = await connection.management()
80+
yield management
81+
await management.close()

0 commit comments

Comments
 (0)