testutils

package
v0.0.0-...-773478a Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertContains

func AssertContains[T comparable](t testing.TB, expected T, testee []T, title string)

func AssertContainsAll

func AssertContainsAll[T comparable](t testing.TB, expected []T, testee []T, title string)

func AssertEquals

func AssertEquals(t testing.TB, expected, actual any, title string)

func AssertError

func AssertError(t testing.TB, err error, title string)

func AssertNoError

func AssertNoError(t testing.TB, err error, title string)

func AssertNotEquals

func AssertNotEquals(t testing.TB, expected, actual any, title string)

func AssertNotNil

func AssertNotNil(t testing.TB, actual any, title string)

func AssertStringContains

func AssertStringContains(t testing.TB, expected, testee, title string)

func SkipIntegrationTest

func SkipIntegrationTest(t testing.TB)

Types

type Response

type Response struct {
	T          testing.TB
	StatusCode int
	// contains filtered or unexported fields
}

func NewResponse

func NewResponse(t testing.TB, response *http.Response) Response

func (*Response) Body

func (r *Response) Body() map[string]interface{}

func (*Response) Decode

func (r *Response) Decode(value interface{}) error

type TestServer

type TestServer struct {
	*httptest.Server
	T      testing.TB
	Client *http.Client
}

func NewTestServer

func NewTestServer(t testing.TB, handler http.Handler) *TestServer

func (*TestServer) DELETE

func (ts *TestServer) DELETE(path string) Response

func (*TestServer) GET

func (ts *TestServer) GET(path string) Response

func (*TestServer) POST

func (ts *TestServer) POST(path string, body string) Response

func (*TestServer) PUT

func (ts *TestServer) PUT(path string, body string) Response

Jump to

Keyboard shortcuts

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