test

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestDirectory

func CreateTestDirectory(t *testing.T) (path string, cleanup func())

CreateTestDirectory creates a temporary folder which will be deleted when cleanup is called.

func CreateTestFile

func CreateTestFile(t *testing.T, path string)

CreateTestFile creates a fake file with "hello" as the content.

func GetTestToken

func GetTestToken() string

Types

type ServerTest

type ServerTest struct {
	// contains filtered or unexported fields
}

func NewTestServer

func NewTestServer() *ServerTest

func (*ServerTest) OpenAITestServer

func (ts *ServerTest) OpenAITestServer() *httptest.Server

OpenAITestServer Creates a mocked OpenAI server which can pretend to handle requests during testing.

func (*ServerTest) RegisterHandler

func (ts *ServerTest) RegisterHandler(path string, handler handler)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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