test: 更新 AgentScope 相关单元测试与集成测试

- 重命名 test_react_runner.py 为 test_runner.py
- 新增 test_utils.py 测试工具函数
- 更新现有测试用例适配新架构
This commit is contained in:
qzl
2026-03-16 16:11:06 +08:00
parent 36b104fa37
commit e55f12cdc1
15 changed files with 753 additions and 717 deletions
@@ -126,3 +126,34 @@ def test_validate_run_request_messages_contract_rejects_binary_data_block() -> N
with pytest.raises(ValueError, match="binary content requires url"):
validate_run_request_messages_contract(run_input)
def test_parse_run_input_accepts_snake_case_aliases() -> None:
payload = {
"thread_id": "00000000-0000-0000-0000-000000000001",
"run_id": "run-1",
"state": {},
"messages": [
{
"id": "u1",
"role": "user",
"content": [
{"type": "text", "text": "hello"},
{
"type": "binary",
"mime_type": "image/png",
"url": "https://signed.example/a.png",
},
],
}
],
"tools": [],
"context": [],
"forwarded_props": {},
}
run_input = parse_run_input(payload)
assert run_input.thread_id == "00000000-0000-0000-0000-000000000001"
assert run_input.run_id == "run-1"
validate_run_request_messages_contract(run_input)