mockutil

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckJSON

func CheckJSON(t *testing.T, r io.ReadCloser, v interface{}, expect interface{})

CheckJSON checks the body extracted from the passed io.ReadCloser against the passed expected value, assuming the body contains JSON data. v will be used to decode into and should not contain any data.

func CheckMultipart

func CheckMultipart(
	t *testing.T, body io.ReadCloser, h http.Header, v interface{}, expectJSON interface{}, f []sendpart.File,
)

CheckMultipart checks if the passed request contains the passed JSON body and the passed []api.SendMessageFile.

The expectJSON parameter may be nil, indicating no JSON body.

func CheckQuery

func CheckQuery(t *testing.T, query url.Values, expect url.Values)

CheckQuery checks if the passed query contains the values found in except.

func WriteJSON

func WriteJSON(t *testing.T, w http.ResponseWriter, v interface{})

WriteJSON writes the passed value to the passed http.ResponseWriter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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