feat(agent): 补充会话上下文构建单元测试
This commit is contained in:
@@ -57,6 +57,11 @@ async def test_run_agentscope_task_calls_runtime_run(
|
|||||||
_fake_get_redis_client,
|
_fake_get_redis_client,
|
||||||
)
|
)
|
||||||
monkeypatch.setattr(tasks_module, "AsyncSessionLocal", lambda: _FakeSessionCtx())
|
monkeypatch.setattr(tasks_module, "AsyncSessionLocal", lambda: _FakeSessionCtx())
|
||||||
|
monkeypatch.setattr(
|
||||||
|
tasks_module,
|
||||||
|
"_build_recent_context_messages",
|
||||||
|
lambda **_: [],
|
||||||
|
)
|
||||||
|
|
||||||
result = await tasks_module.run_agentscope_task(
|
result = await tasks_module.run_agentscope_task(
|
||||||
{
|
{
|
||||||
@@ -107,6 +112,11 @@ async def test_run_agentscope_task_includes_recent_context_messages(
|
|||||||
_fake_get_redis_client,
|
_fake_get_redis_client,
|
||||||
)
|
)
|
||||||
monkeypatch.setattr(tasks_module, "AsyncSessionLocal", lambda: _FakeSessionCtx())
|
monkeypatch.setattr(tasks_module, "AsyncSessionLocal", lambda: _FakeSessionCtx())
|
||||||
|
monkeypatch.setattr(
|
||||||
|
tasks_module,
|
||||||
|
"_build_recent_context_messages",
|
||||||
|
lambda **_: [],
|
||||||
|
)
|
||||||
monkeypatch.setattr(
|
monkeypatch.setattr(
|
||||||
tasks_module,
|
tasks_module,
|
||||||
"_build_recent_context_messages",
|
"_build_recent_context_messages",
|
||||||
|
|||||||
Reference in New Issue
Block a user