Unit (hermetic): serving a dir that contains a `tools/` `kind: script` spec succeeds. serve_agent_dir runs AgentDir::load synchronously (parsing tools/), so a malformed tool spec would raise here; a valid one yields a healthy handle that stops cleanly. No provider call is made.
()
| 55 | |
| 56 | |
| 57 | def test_serve_with_script_tool() -> None: |
| 58 | """Unit (hermetic): serving a dir that contains a `tools/` `kind: script` |
| 59 | spec succeeds. serve_agent_dir runs AgentDir::load synchronously (parsing |
| 60 | tools/), so a malformed tool spec would raise here; a valid one yields a |
| 61 | healthy handle that stops cleanly. No provider call is made.""" |
| 62 | agent = Agent.create(INLINE_CONFIG) |
| 63 | agent_dir = _write_agent_dir(with_schedule=False, with_tools=True) |
| 64 | workspace = tempfile.mkdtemp(prefix="a3s-code-serve-tools-ws-") |
| 65 | |
| 66 | handle = agent.serve_agent_dir(agent_dir, workspace) |
| 67 | assert handle.is_stopped() is False, "a tools/ kind:script agent dir should serve" |
| 68 | handle.stop() |
| 69 | assert handle.is_stopped() is True |
| 70 | print("python sdk serve with kind:script tool ok") |
| 71 | |
| 72 | |
| 73 | def test_serve_handle_lifecycle() -> None: |
no test coverage detected