tests

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestSetup added in v1.0.0

func NewTestSetup(t *testing.T, options ...TestClientOption) app.Gogetter

Types

type SubstitutedRequest added in v1.0.0

type SubstitutedRequest struct {
	app.Request
	Response     string
	ResponseCode int
}

func (SubstitutedRequest) Apply added in v1.0.0

func (SubstitutedRequest) String added in v1.0.0

func (s SubstitutedRequest) String() string

func (SubstitutedRequest) ToHttpResponse added in v1.0.0

func (s SubstitutedRequest) ToHttpResponse() *http.Response

type TestClientOption

type TestClientOption interface {
	Apply(t TestHttpClient) TestHttpClient
}

type TestHttpClient

type TestHttpClient struct {
	SubstitutedRequests []SubstitutedRequest
}

func NewTestClient

func NewTestClient(options ...TestClientOption) TestHttpClient

func (TestHttpClient) Do

func (t TestHttpClient) Do(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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