testing

package
v1.1.0-beta3 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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