mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-26 23:51:14 +02:00
test: guard capability tool runtime injection
This commit is contained in:
parent
950de5e670
commit
47d35faeed
1 changed files with 11 additions and 0 deletions
|
|
@ -137,6 +137,17 @@ async def test_tool_registers_run_citation_when_stored(isolate, monkeypatch):
|
|||
assert "run_abc-123" in message.content
|
||||
|
||||
|
||||
async def test_runtime_survives_langchain_arg_parsing(isolate):
|
||||
"""runtime must survive langchain arg parsing (else ToolNode drops it)."""
|
||||
cap = _capability(name="web.scrape", output=_EchoOutput(echoed="hi"))
|
||||
tools = isolate.module.build_capability_tools(workspace_id=7, capabilities=[cap])
|
||||
tool = _verb_tool(tools, "web_scrape")
|
||||
|
||||
parsed = tool._parse_input({"text": "x", "runtime": "RT"}, "tc_1")
|
||||
|
||||
assert parsed["runtime"] == "RT"
|
||||
|
||||
|
||||
async def test_tool_charges_owner(isolate):
|
||||
output = _EchoOutput(echoed="hi")
|
||||
cap = _capability(name="web.scrape", output=output)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue