fix the lint error in backend

This commit is contained in:
Willem Jiang
2026-04-26 15:09:25 +08:00
parent 3b71e2d377
commit 829e82a9af
15 changed files with 76 additions and 49 deletions
@@ -1,4 +1,5 @@
"""Tests for paginated list_messages_by_run across all RunEventStore backends."""
import pytest
from deerflow.runtime.events.store.memory import MemoryRunEventStore
@@ -14,14 +15,19 @@ async def test_list_messages_by_run_default_returns_all(base_store):
store = base_store
for i in range(7):
await store.put(
thread_id="t1", run_id="run-a",
thread_id="t1",
run_id="run-a",
event_type="human_message" if i % 2 == 0 else "ai_message",
category="message", content=f"msg-a-{i}",
category="message",
content=f"msg-a-{i}",
)
for i in range(3):
await store.put(
thread_id="t1", run_id="run-b",
event_type="human_message", category="message", content=f"msg-b-{i}",
thread_id="t1",
run_id="run-b",
event_type="human_message",
category="message",
content=f"msg-b-{i}",
)
await store.put(thread_id="t1", run_id="run-a", event_type="tool_call", category="trace", content="trace")
@@ -36,9 +42,11 @@ async def test_list_messages_by_run_with_limit(base_store):
store = base_store
for i in range(7):
await store.put(
thread_id="t1", run_id="run-a",
thread_id="t1",
run_id="run-a",
event_type="human_message" if i % 2 == 0 else "ai_message",
category="message", content=f"msg-a-{i}",
category="message",
content=f"msg-a-{i}",
)
msgs = await store.list_messages_by_run("t1", "run-a", limit=3)
@@ -52,9 +60,11 @@ async def test_list_messages_by_run_after_seq(base_store):
store = base_store
for i in range(7):
await store.put(
thread_id="t1", run_id="run-a",
thread_id="t1",
run_id="run-a",
event_type="human_message" if i % 2 == 0 else "ai_message",
category="message", content=f"msg-a-{i}",
category="message",
content=f"msg-a-{i}",
)
all_msgs = await store.list_messages_by_run("t1", "run-a")
@@ -69,9 +79,11 @@ async def test_list_messages_by_run_before_seq(base_store):
store = base_store
for i in range(7):
await store.put(
thread_id="t1", run_id="run-a",
thread_id="t1",
run_id="run-a",
event_type="human_message" if i % 2 == 0 else "ai_message",
category="message", content=f"msg-a-{i}",
category="message",
content=f"msg-a-{i}",
)
all_msgs = await store.list_messages_by_run("t1", "run-a")
@@ -86,13 +98,19 @@ async def test_list_messages_by_run_does_not_include_other_run(base_store):
store = base_store
for i in range(7):
await store.put(
thread_id="t1", run_id="run-a",
event_type="human_message", category="message", content=f"msg-a-{i}",
thread_id="t1",
run_id="run-a",
event_type="human_message",
category="message",
content=f"msg-a-{i}",
)
for i in range(3):
await store.put(
thread_id="t1", run_id="run-b",
event_type="human_message", category="message", content=f"msg-b-{i}",
thread_id="t1",
run_id="run-b",
event_type="human_message",
category="message",
content=f"msg-b-{i}",
)
msgs = await store.list_messages_by_run("t1", "run-b")