testsupport

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package testutil contains shared assertions for the two SDK contract suites.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFields

func CheckFields(t *testing.T, v reflect.Value, path string)

CheckFields validates concrete decoded values as well as presence metadata, including objects inside dynamic maps and unions.

func FailureContracts

func FailureContracts(t *testing.T, endpoints []Endpoint, client func(Transport) any)

FailureContracts exercises every documented endpoint through its public service method. Expected HTTP failures are independent of parameter/response fixture generation.

func InvokeJSON

func InvokeJSON(t *testing.T, client any, ep Endpoint, body json.RawMessage) (any, error)

InvokeJSON calls one service with a documented request example. Path arguments are deliberately awkward to exercise escaping independently of payload values.

func ResourceAlreadyGone

func ResourceAlreadyGone(err error) bool

func SafeError

func SafeError(err error) string

SafeError omits response bodies and URLs: either may contain a token or a presigned storage grant. Request IDs are enough to correlate server diagnostics.

Types

type CleanupFailure

type CleanupFailure struct{ Err error }

CleanupFailure identifies an incomplete cleanup step, not an already deleted target resource (for example, a batch output which has not been generated).

func (*CleanupFailure) Error

func (e *CleanupFailure) Error() string

func (*CleanupFailure) Unwrap

func (e *CleanupFailure) Unwrap() error

type Endpoint

type Endpoint struct{ Service, Method string }

type Transport

type Transport func(*http.Request) (*http.Response, error)

func (Transport) RoundTrip

func (f Transport) RoundTrip(r *http.Request) (*http.Response, error)

type TurnResult

type TurnResult struct {
	Text     string
	LastID   string
	ToolUsed bool
	Complete bool
}

TurnResult only accepts assistant output followed by a terminal idle event. User messages and tool output cannot satisfy the result assertion.

func (*TurnResult) Observe

func (r *TurnResult) Observe(raw string) error

func (TurnResult) Verify

func (r TurnResult) Verify(expected []string, requireTool bool) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL