test: remove unreachable cases and strengthen weak assertions

This commit is contained in:
chengyongru authored and chengyongru committed 2026-10-22 17:19:20 +08:00
1 parent 169062be11
commit abfe510ce1
25 files changed
+64 -302

No files matched your search

-20
View File
@@ -340,26 +340,6 @@ class TestCheckExpired:
await ac.check_expired(scheduler, _resolve_runtime)
scheduler.assert_not_called()
async def test_session_with_no_key_skips(self):
"""Session info with empty/missing key should be skipped."""
ac = _make_autocompact(ttl=15)
mock_sm = _mock_sessions()
mock_sm.list_sessions.return_value = [{"key": "", "updated_at": "old"}]
ac.sessions = mock_sm
scheduler = MagicMock()
await ac.check_expired(scheduler, _resolve_runtime)
scheduler.assert_not_called()
async def test_session_with_missing_key_field_skips(self):
"""Session info dict without 'key' field should be skipped."""
ac = _make_autocompact(ttl=15)
mock_sm = _mock_sessions()
mock_sm.list_sessions.return_value = [{"updated_at": "old"}]
ac.sessions = mock_sm
scheduler = MagicMock()
await ac.check_expired(scheduler, _resolve_runtime)
scheduler.assert_not_called()
async def test_dream_session_skips(self):
"""Internal Dream sessions should not be scheduled for idle compact."""
ac = _make_autocompact(ttl=15)