testutils

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 21 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 CheckNoServerError added in v0.0.9

func CheckNoServerError(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 PrepareFsForTests added in v0.0.9

func PrepareFsForTests(t *testing.T, folder string) afero.Fs

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

func WithTmpCerts added in v0.0.9

func WithTmpCerts(action func(t *testing.T, certs *Certs)) func(t *testing.T)

Types

type Certs added in v0.0.9

type Certs struct {
	ServerTLSConf *tls.Config
	ClientTLSConf *tls.Config
	CertPath      string
	KeyPath       string
}

type RoundTripFunc

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

func (RoundTripFunc) RoundTrip

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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