testutils

package
v0.0.0-...-b26b1c1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockHTTPClient

func NewMockHTTPClient(t *testing.T, calls ...Call) *mockHTTPClient

func ValidateRequest

func ValidateRequest(t *testing.T, req *http.Request, method string, url string, body string) bool

ValidateRequest is a utility

Types

type Call

type Call struct {
	// Validate is an optional function that, if set, will validate an incoming request
	Validate       func(req *http.Request) bool
	ResponseStatus int
	ResponseBody   string
	ResponseError  error
}

Jump to

Keyboard shortcuts

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