Skip to main content

Crate okbot_testkit

Crate okbot_testkit 

Source
Expand description

Test doubles and fixtures for okbot crates and third-party adapters.

Modules§

conformance
Conformance suites: call them from an implementation’s tests.

Structs§

CollectSink
An InboundSink that keeps every event, for adapter tests.
FakeAgent
An AgentBackend for tests: echoes, replies, fails or sleeps, and records its turns.
FakeChannel
A Channel for tests: events are injected by the test, sent messages are recorded.
ManualClock
A clock that only moves when told to. Starts at 2026-01-01T00:00:00Z.
MemoryStore
A ConversationStore kept in memory, for runtime tests.
MemoryTasks
A TaskStore kept in memory, for runtime tests: every requester sees every task, ids are tasks/test/t-<n>, and no rule is checked.
PlainRenderer
A Renderer that sends the Markdown unchanged as one message.

Functions§

bot_message
A bot message in key.
conversation
A conversation key for channel (platform:instance) and room.
fake_cli
Writes an executable shell script dir/name that prints 1.0.0 for --version and runs body otherwise (Unix only). Mirrors agent-call’s test helper.
inbound
An inbound text event from user user in room of channel, with a unique event id.
turn
A minimal turn with prompt, the default tool policy and a temp working directory.
user_message
A user message in key, written by user u1 (“Ana”).