feat: merge draft step maps
This commit is contained in:
@@ -700,6 +700,28 @@ async def test_rpc_draft_workspace_focused_edit_methods(tmp_path) -> None:
|
||||
"output_map": {"value": "state.value"},
|
||||
},
|
||||
)
|
||||
input_merged = await _rpc(
|
||||
client,
|
||||
"workflow.draft_workspaces.set_step_input_map",
|
||||
{
|
||||
"workspace_id": "focused_ws",
|
||||
"revision": 5,
|
||||
"step_id": "call",
|
||||
"input_map": {"input.extra": "extra"},
|
||||
"merge": True,
|
||||
},
|
||||
)
|
||||
output_merged = await _rpc(
|
||||
client,
|
||||
"workflow.draft_workspaces.set_step_output_map",
|
||||
{
|
||||
"workspace_id": "focused_ws",
|
||||
"revision": 6,
|
||||
"step_id": "call",
|
||||
"output_map": {"extra": "state.extra"},
|
||||
"merge": True,
|
||||
},
|
||||
)
|
||||
fetched = await _rpc(
|
||||
client,
|
||||
"workflow.draft_workspaces.get",
|
||||
@@ -710,6 +732,8 @@ async def test_rpc_draft_workspace_focused_edit_methods(tmp_path) -> None:
|
||||
assert routed["result"]["revision"] == 3
|
||||
assert input_mapped["result"]["revision"] == 4
|
||||
assert output_mapped["result"]["revision"] == 5
|
||||
assert input_merged["result"]["revision"] == 6
|
||||
assert output_merged["result"]["revision"] == 7
|
||||
draft = fetched["result"]["draft"]
|
||||
assert draft["name"] == "focused_renamed"
|
||||
assert draft["routes"]["call"]["ok"] == "__end__"
|
||||
@@ -717,13 +741,21 @@ async def test_rpc_draft_workspace_focused_edit_methods(tmp_path) -> None:
|
||||
{
|
||||
"target": {"root": "local", "parts": ["value"]},
|
||||
"path": {"root": "input", "parts": ["value"]},
|
||||
}
|
||||
},
|
||||
{
|
||||
"target": {"root": "local", "parts": ["extra"]},
|
||||
"path": {"root": "input", "parts": ["extra"]},
|
||||
},
|
||||
]
|
||||
assert draft["steps"]["call"]["output"] == [
|
||||
{
|
||||
"source": {"root": "local", "parts": ["value"]},
|
||||
"target": {"root": "state", "parts": ["value"]},
|
||||
}
|
||||
},
|
||||
{
|
||||
"source": {"root": "local", "parts": ["extra"]},
|
||||
"target": {"root": "state", "parts": ["extra"]},
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user