> This page is for Server SDKs.

> 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.