Documentation
¶
Overview ¶
Package openapitest provides a reusable mock HTTP API, fixture workspace materialization, and helpers for OpenAPI dynamic tool smoke tests.
Index ¶
- Constants
- func FixturesDir(t *testing.T) string
- func Materialize(t *testing.T, baseURL string, apiFile ...string) string
- func NewProvider(t *testing.T, root string) agentkit.ToolProvider
- func ToolByName(t *testing.T, ctx context.Context, provider agentkit.ToolProvider, name string) agentkit.Tool
- func TurnContext(sessionID agentkit.SessionID, agentID agentkit.AgentID, userID string, ...) context.Context
- func Workspace(root string) workspace.Service
- type Mock
Constants ¶
View Source
const ( // DefaultToken is the bearer token expected by the mock API and fixture auth. DefaultToken = "openapitest-token" // BaseURLPlaceholder is substituted when materializing api.json from fixtures. BaseURLPlaceholder = "{{BASE_URL}}" )
Variables ¶
This section is empty.
Functions ¶
func FixturesDir ¶
FixturesDir returns the repo-relative fixtures/openapi directory.
func Materialize ¶
Materialize copies fixture files into a temp workspace and substitutes baseURL into the chosen api.json variant (default api.json).
func NewProvider ¶
func NewProvider(t *testing.T, root string) agentkit.ToolProvider
NewProvider builds tool/openapi against a materialized workspace.
func ToolByName ¶
func ToolByName(t *testing.T, ctx context.Context, provider agentkit.ToolProvider, name string) agentkit.Tool
ToolByName lists tools from the provider and returns the named tool.
Types ¶
Click to show internal directories.
Click to hide internal directories.