tests

package
v0.0.0-...-706d53e Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertHTMLResponse

func AssertHTMLResponse(t *testing.T, fileName string, actual string)

func AssertJSONResponse

func AssertJSONResponse(t *testing.T, fileName string, actual string)

func GetGoldenFilePath

func GetGoldenFilePath(filePath string) string

Types

type HTTPTestCase

type HTTPTestCase struct {
	Name           string
	GoldenFile     string
	StatusCode     int
	RequestOptions []RequestOption
	Mock           func(t *testing.T)
}

type HTTPTestSuite

type HTTPTestSuite struct{}

func (*HTTPTestSuite) DoRequest

func (s *HTTPTestSuite) DoRequest(
	t *testing.T,
	handler internalerrors.ErrorAwareHTTPHandler,
	opts ...RequestOption,
) (*http.Response, []byte)

func (*HTTPTestSuite) RunHTTPCases

func (s *HTTPTestSuite) RunHTTPCases(t *testing.T, handler internalerrors.ErrorAwareHTTPHandler, cases []HTTPTestCase)

type RequestBody

type RequestBody struct {
	Body io.Reader
}

func (RequestBody) Value

func (r RequestBody) Value() any

type RequestBodyFromFile

type RequestBodyFromFile struct {
	FilePath string
}

func (RequestBodyFromFile) Value

func (r RequestBodyFromFile) Value() any

type RequestContext

type RequestContext struct {
	Context context.Context //nolint:containedctx
}

func (RequestContext) Value

func (r RequestContext) Value() any

type RequestOption

type RequestOption interface {
	Value() any
}

type RequestParams

type RequestParams struct {
	Params requestParams
}

func (RequestParams) Value

func (r RequestParams) Value() any

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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