Documentation ¶
Index ¶
- func AssertCorsHeaders(t *testing.T, res *http.Response, methods string)
- func AssertDefaultHeaders(t *testing.T, res *http.Response, contentType, methods string)
- func AssertEmptyBody(t *testing.T, body io.Reader)
- func AssertErrorBody(t *testing.T, body io.Reader) wrapped.WrappedReply
- func AssertNotEmptyBody(t *testing.T, body io.Reader) []byte
- func CallWithJSON(method string, url string, data interface{}) *http.Response
- func PrintBody(t *testing.T, res *http.Response) io.Reader
- func PrintResponse(t *testing.T, body io.Reader)
- func PrintTestDescription(t *testing.T, desc string)
- func SetWorkingDir(binDir string)
- func VerifyBadMethods(t *testing.T, url string, corsMethods string, badMethods []string)
- type APICall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertCorsHeaders ¶
AssertCorsHeaders asserts that the response 'res' contains the expect CORS headers and values; including the endpoint dependent 'methods'.
func AssertDefaultHeaders ¶
AssertDefaultHeaders asserts that the response 'res' default headers exist. This includes the value of dynamic headers 'contentType' and CORS 'methods'
func AssertEmptyBody ¶
AssertEmptyBody asserts that a response 'body' is empty.
func AssertErrorBody ¶
AssertErrorBody assert that a response 'body' is a generic response error. Returns the parsed response error.
func AssertNotEmptyBody ¶
AssertNotEmptyBody asserts that a response 'body' is NOT empty. The body is returned.
func CallWithJSON ¶
CallWithJSON calls an API endpoint with the specified details.
func PrintBody ¶
PrintBody parses the body of response 'res' and prints it to the test logs returning a new reader for the data.
func PrintResponse ¶
PrintResponse prints the 'body' of a response to the test logs.
func PrintTestDescription ¶
PrintTestDescription prints the test description to the test logs.
func SetWorkingDir ¶
func SetWorkingDir(binDir string)
SetWorkingDir sets the working directory so the server has access to resources.