testing

package
v1.1.0-beta5 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package testing provides functionality for use when conducting tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestInstance

func NewTestInstance(
	configFile string,
	defaultPathConfigs func(*oo.Options) map[string]*po.Options,
	respCode int, respBody string, respHeaders map[string]string,
	originType, urlPath, logLevel string,
) (*httptest.Server, *httptest.ResponseRecorder, *http.Request, *http.Client, error)

NewTestInstance will start a trickster

func NewTestPathConfig

func NewTestPathConfig(
	oc *oo.Options,
	defaultPathConfigs func(*oo.Options) map[string]*po.Options,
	urlPath string,
) *po.Options

NewTestPathConfig returns a path config based on the provided parameters

func NewTestServer

func NewTestServer(responseCode int, responseBody string, headers map[string]string) *httptest.Server

NewTestServer returns a new httptest.Server that responds with the provided code, body and headers

func NewTestWebClient

func NewTestWebClient() *http.Client

NewTestWebClient returns a new *http.Client configured with reasonable defaults

Types

This section is empty.

Jump to

Keyboard shortcuts

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