Check retrieval of a session from the pool and verify its properties.
(session_pool: SessionPool)
| 73 | |
| 74 | |
| 75 | async def test_get_session(session_pool: SessionPool) -> None: |
| 76 | """Check retrieval of a session from the pool and verify its properties.""" |
| 77 | session = await session_pool.get_session() |
| 78 | assert session is not None |
| 79 | assert session.expires_at >= datetime.now(timezone.utc) |
| 80 | assert not session.is_blocked |
| 81 | assert not session.is_expired |
| 82 | assert not session.is_max_usage_count_reached |
| 83 | assert session.is_usable |
| 84 | |
| 85 | |
| 86 | async def test_get_session_no_usable(caplog: pytest.LogCaptureFixture, session_pool: SessionPool) -> None: |
nothing calls this directly
no test coverage detected