From 4bcf6e68941e8c1237daf3727cb53616bbddf564 Mon Sep 17 00:00:00 2001 From: RockChinQ Date: Sun, 11 Oct 2026 16:35:55 +0000 Subject: [PATCH] test: align inactive bot log expectation with empty result --- tests/unit_tests/api/service/test_bot_service.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/unit_tests/api/service/test_bot_service.py b/tests/unit_tests/api/service/test_bot_service.py index 37427e95c..da2bedff6 100644 --- a/tests/unit_tests/api/service/test_bot_service.py +++ b/tests/unit_tests/api/service/test_bot_service.py @@ -672,8 +672,8 @@ class TestBotServiceDeleteBot: class TestBotServiceListEventLogs: """Tests for list_event_logs method.""" - async def test_list_event_logs_bot_not_found_raises(self): - """Raises Exception when runtime bot not found.""" + async def test_list_event_logs_inactive_bot_returns_empty(self): + """A saved bot without an active runtime has no event logs.""" # Setup ap = SimpleNamespace() ap.platform_mgr = SimpleNamespace() @@ -683,8 +683,7 @@ class TestBotServiceListEventLogs: service.get_bot = AsyncMock(return_value={'uuid': 'nonexistent-uuid'}) # Execute & Verify - with pytest.raises(Exception, match='Bot not found'): - await service.list_event_logs(WORKSPACE_UUID, 'nonexistent-uuid', 0, 10) + assert await service.list_event_logs(WORKSPACE_UUID, 'nonexistent-uuid', 0, 10) == ([], 0) async def test_list_event_logs_returns_logs(self): """Returns logs from runtime bot logger."""