testutil

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertJSONEqual

func AssertJSONEqual(t *testing.T, expected, actual string)

AssertJSONEqual asserts two JSON strings are equal

func CreateAnthropicRequest

func CreateAnthropicRequest(messages []map[string]interface{}, streaming bool) map[string]interface{}

CreateAnthropicRequest creates a standard Anthropic API request for testing

func CreateJSONRequest

func CreateJSONRequest(t *testing.T, method, url string, body interface{}) *http.Request

CreateJSONRequest creates an HTTP request with JSON body

func CreateMockServer

func CreateMockServer(handler http.HandlerFunc) *httptest.Server

CreateMockServer creates a test HTTP server with the given handler

func CreateOpenAIResponse

func CreateOpenAIResponse(content string, finishReason string) map[string]interface{}

CreateOpenAIResponse creates a standard OpenAI API response for testing

Types

This section is empty.

Jump to

Keyboard shortcuts

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