forgetest

package
v0.0.44 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(expected interface{}, actual interface{}) error

func MockRoundTripperQueue

func MockRoundTripperQueue(t *testing.T, queue []MockRoundTripFunc) http.RoundTripper

Types

type AssertFailure

type AssertFailure struct {
	Expected interface{}
	Actual   interface{}
}

type ExpectedTestRequest added in v0.0.32

type ExpectedTestRequest struct {
	Method    string
	Path      string
	Validator func(r *http.Request) error
}

type MockRoundTripFunc

type MockRoundTripFunc func(t *testing.T, request *http.Request) (*http.Response, error)

func ServeAndValidate added in v0.0.32

func ServeAndValidate(t *testing.T, r TestResponse, expected ExpectedTestRequest) MockRoundTripFunc

type MockableRoundTripper

type MockableRoundTripper struct {
	RoundTripFunc func(*http.Request) (*http.Response, error)
}

func (MockableRoundTripper) RoundTrip

func (mockable MockableRoundTripper) RoundTrip(request *http.Request) (*http.Response, error)

type TestResponse added in v0.0.32

type TestResponse interface {
	CreateResponse() (*http.Response, error)
}

type TestResponseFile added in v0.0.32

type TestResponseFile struct {
	StatusCode int
	FilePath   string
}

func (*TestResponseFile) CreateResponse added in v0.0.32

func (f *TestResponseFile) CreateResponse() (*http.Response, error)

Jump to

Keyboard shortcuts

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