testkit

package
v0.0.0-...-d736df5 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FatalIf

func FatalIf(t T, condition bool, format string, v ...interface{})

func FatalIfError

func FatalIfError(t T, err error)

func FatalIfWrongError

func FatalIfWrongError(t T, err error, message string)

func FatalIfWrongResponseBody

func FatalIfWrongResponseBody(t T, resp *http.Response, body string)

func FatalIfWrongResponseStatus

func FatalIfWrongResponseStatus(t T, resp *http.Response, statusCode int)

func NewJsonTestServer

func NewJsonTestServer(statusCode int, val interface{}) *httptest.Server

func NewTestServer

func NewTestServer(statusCode int, body []byte) *httptest.Server

func RecordResponse

func RecordResponse(handler func(http.ResponseWriter, *http.Request), req *http.Request) *http.Response

Types

type T

type T interface {
	Logf(format string, args ...interface{})
	FailNow()
}

Jump to

Keyboard shortcuts

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