tester

package
v0.0.0-...-226ad4c Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoRequestOnHandler

func DoRequestOnHandler(t *testing.T, router http.Handler, method string, route string, headers map[string]string, payload string, expectedStatus int, expectedBody string) string

DoRequestOnHandler does a request on a router (or handler) and check the response

func DoRequestOnServer

func DoRequestOnServer(t *testing.T, hostname string, port string, jar *cookiejar.Jar, method string, testURL string, headers map[string]string, payload string, expectedStatus int, expectedBody string, followRedirects bool) string

DoRequestOnServer does a request on listening server

Types

type DoFn

type DoFn func(method string, url string, headers map[string]string, payload string, expectedStatus int, expectedBody string) string

func CreateServerTester

func CreateServerTester(t *testing.T, hostname string, port string, jar *cookiejar.Jar, followRedirects bool) DoFn

CreateServerTester wraps DoRequestOnServer to factorize t, port and jar

Jump to

Keyboard shortcuts

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