Module adcp.testing
Test helpers for AdCP client library.
Provides pre-configured test agents for examples and quick testing.
All test agents include a .simple accessor for ergonomic usage:
- Standard API (client methods): Full TaskResult with error handling
- Simple API (client.simple methods): Direct returns, raises on error
Example
Standard API - explicit control
result = await test_agent.get_products(GetProductsRequest(brief='Coffee')) if result.success: print(result.data.products)
Simple API - ergonomic
products = await test_agent.simple.get_products(brief='Coffee') print(products.products)
Sub-modules
adcp.testing.test_helpers-
Test agent helpers for easy examples and quick testing …
Functions
def create_test_agent(**overrides: Any) ‑> AgentConfig-
Expand source code
def create_test_agent(**overrides: Any) -> AgentConfig: """Create a custom test agent configuration. Useful when you need to modify the default test agent setup. Args: **overrides: Keyword arguments to override default config values Returns: Complete agent configuration Example: ```python from adcp.testing import create_test_agent from adcp.client import ADCPClient # Use default test agent with custom ID config = create_test_agent(id="my-test-agent") client = ADCPClient(config) ``` Example: ```python # Use A2A protocol instead of MCP from adcp.types.core import Protocol config = create_test_agent( protocol=Protocol.A2A, agent_uri="https://test-agent.adcontextprotocol.org" ) ``` """ base_config = TEST_AGENT_MCP_CONFIG.model_dump() base_config.update(overrides) return AgentConfig(**base_config)Create a custom test agent configuration.
Useful when you need to modify the default test agent setup.
Args
**overrides- Keyword arguments to override default config values
Returns
Complete agent configuration
Example
from adcp.testing import create_test_agent from adcp.client import ADCPClient # Use default test agent with custom ID config = create_test_agent(id="my-test-agent") client = ADCPClient(config)Example
# Use A2A protocol instead of MCP from adcp.types.core import Protocol config = create_test_agent( protocol=Protocol.A2A, agent_uri="https://test-agent.adcontextprotocol.org" )