ghttptest

package module
v0.0.0-...-72dca2e Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 9 Imported by: 0

README

ghttptest

test http routes '-'

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertType

func AssertType(t *testing.T, data *map[string]interface{}, key string, want string)

func AssertValue

func AssertValue(t *testing.T, data *map[string]interface{}, key string, want interface{})

func Run

func Run(t *testing.T, requests *[]Request, handler func(w http.ResponseWriter, req *http.Request))

Types

type Request

type Request struct {

	// Subtest Name
	Name string

	// Request Method
	Method string

	// Request Path
	Path string

	// Request Body
	Body interface{}

	// Request Headers
	Headers *map[string]string

	// Response Body
	Response interface{}

	// Response Code
	ResponseCode int

	// Response headers
	ResponseHeaders *map[string]string
}

Jump to

Keyboard shortcuts

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