Skip to main content

Crate traitclaw_test_utils

Crate traitclaw_test_utils 

Source
Expand description

§TraitClaw Test Utilities

Shared test utilities for the TraitClaw AI Agent Framework.

This crate provides reusable mock implementations and helpers for testing agents without hitting real LLM APIs:

  • MockProvider — Deterministic LLM provider returning pre-defined responses
  • MockMemory — In-memory session-based memory backend
  • EchoTool — Tool that echoes its input for tool-calling tests
  • FailTool — Tool that always returns an error
  • make_runtime — One-call AgentRuntime setup for strategy tests

§Quick Start

use traitclaw_test_utils::provider::MockProvider;
use traitclaw_test_utils::runtime::make_runtime;

let runtime = make_runtime(MockProvider::text("hello"), vec![]);
// Use runtime with any AgentStrategy for deterministic testing

Modules§

memory
Mock memory backend for testing.
provider
Mock LLM provider for deterministic testing.
runtime
Runtime construction helpers for strategy tests.
tools
Mock tools for testing tool-calling scenarios.