study

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 9 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 RoundTripperQueue

func RoundTripperQueue(t *testing.T, queue []RoundTripFunc) http.RoundTripper

Types

type AssertFailure

type AssertFailure struct {
	Expected interface{} `json:"expected"`
	Actual   interface{} `json:"actual"`
}

type ExpectedTestRequest

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

type RoundTripFunc

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

func ServeAndValidate

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

type RoundTripper

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

func (RoundTripper) RoundTrip

func (r RoundTripper) RoundTrip(request *http.Request) (*http.Response, error)

type TestResponse

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

type TestResponseFile

type TestResponseFile struct {
	StatusCode int
	FilePath   string
}

func (*TestResponseFile) CreateResponse

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