Test adding sessions to the session pool increases session counts appropriately.
(session_pool: SessionPool)
| 48 | |
| 49 | |
| 50 | async def test_add_session(session_pool: SessionPool) -> None: |
| 51 | """Test adding sessions to the session pool increases session counts appropriately.""" |
| 52 | session_01 = Session(id='test_session_01') |
| 53 | session_02 = Session(id='test_session_02') |
| 54 | session_pool.add_session(session=session_01) |
| 55 | session_pool.add_session(session=session_02) |
| 56 | assert session_pool.session_count == MAX_POOL_SIZE + 2 |
| 57 | assert session_pool.usable_session_count == MAX_POOL_SIZE + 2 |
| 58 | assert session_pool.retired_session_count == 0 |
| 59 | |
| 60 | |
| 61 | async def test_add_session_duplicate(caplog: pytest.LogCaptureFixture, session_pool: SessionPool) -> None: |
nothing calls this directly
no test coverage detected