fix: bind json rpc list params

This commit is contained in:
lda
2026-06-05 00:37:27 +07:00 Verified
parent 3941b88e8c
commit ab0576f277
13 changed files with 126 additions and 56 deletions
+3
View File
@@ -45,6 +45,9 @@ async def test_rpc_health_and_capability_methods(tmp_path) -> None:
assert health_response.json()["status"] == "ok"
assert health["result"]["status"] == "ok"
assert listed["result"]["capabilities"]
assert {
capability["source_id"] for capability in listed["result"]["capabilities"]
} == {"wf.std"}
assert inspected["result"]["name"] == "wf.std.constant"
@@ -75,6 +75,9 @@ async def test_rpc_workflow_client_lists_and_inspects_capabilities(tmp_path) ->
)
assert listed["capabilities"]
assert {capability["source_id"] for capability in listed["capabilities"]} == {
"wf.std"
}
assert inspected["name"] == "wf.std.constant"
@@ -60,6 +60,27 @@ async def test_mcp_backed_rpc_lists_and_mutates_source_registry(tmp_path) -> Non
assert inspected["entry"]["enabled"] is False
async def test_mcp_backed_rpc_capability_list_filters_by_source(tmp_path) -> None:
config = BrokerConfig(store_root=tmp_path / "store", connections=[])
server = build_workflow_server_from_config(config)
app = create_rpc_app(server)
transport = httpx.ASGITransport(app=app)
async with httpx.AsyncClient(
transport=transport, base_url="http://test"
) as http_client:
client = RpcWorkflowApiClient(
url="http://test/rpc",
http_client=http_client,
)
listed = await client.list_capabilities(source_id="wf.std", limit=100)
assert listed["capabilities"]
assert {capability["source_id"] for capability in listed["capabilities"]} == {
"wf.std"
}
async def test_mcp_backed_rpc_reports_connections_and_events(tmp_path) -> None:
config = BrokerConfig(
store_root=tmp_path / "store",