Fix websocket replay tests

This commit is contained in:
GitHub Copilot
2026-01-27 19:26:39 +00:00
parent bb94f9359d
commit 457ee0f5fd
3 changed files with 29 additions and 1 deletions
+11 -1
View File
@@ -694,7 +694,17 @@ class TestLocalServerMoreCoverage:
assert queue.get_nowait() == "existing"
@pytest.mark.asyncio
async def test_mark_route_activity_triggers_notification(self, server_with_no_apps):
async def test_handle_session_data_marks_activity(self, server_with_no_apps, monkeypatch):
ws = MagicMock()
ws.send_bytes = AsyncMock()
server_with_no_apps._websocket_connections["rk"] = ws
server_with_no_apps._route_last_activity["rk"] = 0.0
await server_with_no_apps.handle_session_data("rk", b"data")
assert server_with_no_apps._route_last_activity["rk"] > 0.0
ws.send_bytes.assert_awaited_once_with(b"data")
def test_mark_route_activity_triggers_notification(self, server_with_no_apps):
"""Test that mark_route_activity triggers SSE notification."""
import asyncio