testutils

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNoError added in v0.0.3

func CheckNoError(t *testing.T, err error)

func FsFromMap added in v0.0.8

func FsFromMap(t *testing.T, files map[string]string) afero.Fs

FsFromMap creates afero.Fs in memory from map. Where key is a filename and value is file context.

func LogTest added in v0.0.7

func LogTest(action func(t *testing.T, output *bytes.Buffer)) func(t *testing.T)

func NewTestClient

func NewTestClient(responseCreator RoundTripFunc) *http.Client

func ReadBody added in v0.0.6

func ReadBody(t *testing.T, recorder *httptest.ResponseRecorder) string

func ReadHeader added in v0.0.7

func ReadHeader(t *testing.T, recorder *httptest.ResponseRecorder) http.Header

Types

type RoundTripFunc

type RoundTripFunc func(req *http.Request) *http.Response

func (RoundTripFunc) RoundTrip

func (f RoundTripFunc) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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