testutils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRequestWithFormParamsToCtx

func AddRequestWithFormParamsToCtx(ctx *gin.Context, method string, params map[string]string)

AddRequestWithFormParamsToCtx attaches a request with given method and form params to the context

func AddUrlParamsToCtx

func AddUrlParamsToCtx(ctx *gin.Context, params map[string]string)

AddUrlParamsToCtx attaches a request with given method and url params to the context

func ConnectToIntegrationTestDB

func ConnectToIntegrationTestDB(t *testing.T) *mongo.Database

ConnectToIntegrationTestDB waits for the integrations tests DB to become available and returns a connection to the DB

func SetEnvVars

func SetEnvVars(vars map[string]string) (restoreVars func())

SetEnvVars sets given environment variables and provides a callback function to restore the variables to their initial values

func UnmarshallResponse

func UnmarshallResponse(res *bytes.Buffer, out interface{}) error

UnmarshallResponse unmarshalls the reponse in res and stores it in out

func UnsetVars

func UnsetVars(vars ...string) (restoreVars func())

UnsetVars unsets given environment variables and provides a callback function to restore the variables to their initial values

Types

type RouterGroupMatcher

type RouterGroupMatcher struct {
	// Path is the base path of the router groups to match
	Path string
}

RouterGroupMatcher matches gin router groups with given path

func (RouterGroupMatcher) Matches

func (r RouterGroupMatcher) Matches(x interface{}) bool

Matches implements the gomock.Matcher interface

func (RouterGroupMatcher) String

func (r RouterGroupMatcher) String() string

Jump to

Keyboard shortcuts

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