> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # Testing > Run an agent's tools through a simulated call in a test, and replay recorded tool requests. [swaig-test]: /docs/server-sdks/reference/python/agents/cli/swaig-test [call-simulator]: /docs/server-sdks/reference/python/agents/testing/call-simulator [request-recorder]: /docs/server-sdks/reference/python/agents/testing/request-recorder The `signalwire.testing` module tests a call flow, such as a confirmation that spans several steps, without the platform or a model. [`swaig-test`][swaig-test] runs one tool call; [`CallSimulator`][call-simulator] runs a sequence of them through a simulated call and checks each one the way the platform does. [`RequestRecorder`][request-recorder] records real tool requests so you can run them against changed code. ```python from signalwire.testing import CallSimulator, RequestRecorder, SimulatedCall, ToolMentionError ``` ## Classes #### [CallSimulator](/docs/server-sdks/reference/python/agents/testing/call-simulator) A simulated call that runs an agent's tools, steps, and state. #### [SimulatedCall](/docs/server-sdks/reference/python/agents/testing/simulated-call) What one tool call came to in the simulation. #### [RequestRecorder](/docs/server-sdks/reference/python/agents/testing/request-recorder) Tool middleware that records tool requests for replay. #### [ToolMentionError](/docs/server-sdks/reference/python/agents/testing/tool-mention-error) Raised when a tool result names a tool the step doesn't offer. ## Docs - [CallSimulator](https://signalwire.com/docs/server-sdks/reference/python/agents/testing/call-simulator.md): Run an agent's tools through a simulated call, checked the way the platform checks them, without the platform or a model. - [agent_says](https://signalwire.com/docs/server-sdks/reference/python/agents/testing/call-simulator/agent-says.md): Add the model's spoken reply to the simulated call, then run any post_process actions waiting for it. - [call](https://signalwire.com/docs/server-sdks/reference/python/agents/testing/call-simulator/call.md): Have the model call a tool in the simulated call, checked against the step's function list and the tool's gates. - [caller](https://signalwire.com/docs/server-sdks/reference/python/agents/testing/call-simulator/caller.md): Add the caller's words to the simulated call. - [gate_conversation](https://signalwire.com/docs/server-sdks/reference/python/agents/testing/call-simulator/gate-conversation.md): Return the dialogue a semantic gate would judge now, chosen by its mark, proposal, or window. - [history_mode](https://signalwire.com/docs/server-sdks/reference/python/agents/testing/call-simulator/history-mode.md): Return the history mode of the simulated call's current step. - [model_view](https://signalwire.com/docs/server-sdks/reference/python/agents/testing/call-simulator/model-view.md): Return the conversation entries the model gets now, after each step's history mode. - [offered](https://signalwire.com/docs/server-sdks/reference/python/agents/testing/call-simulator/offered.md): List the tools the model is offered at this point in the simulated call. - [replay](https://signalwire.com/docs/server-sdks/reference/python/agents/testing/call-simulator/replay.md): Run recorded tool requests against the agent again, each with its own call data. - [RequestRecorder](https://signalwire.com/docs/server-sdks/reference/python/agents/testing/request-recorder.md): Tool middleware that records each tool request so CallSimulator.replay can run them again. - [SimulatedCall](https://signalwire.com/docs/server-sdks/reference/python/agents/testing/simulated-call.md): The outcome of one tool call in a CallSimulator run, with its result, whether it ran, and what blocked it. - [ToolMentionError](https://signalwire.com/docs/server-sdks/reference/python/agents/testing/tool-mention-error.md): Raised by CallSimulator when a tool result names a tool the step it leaves the call in doesn't offer.