test

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertNotifyLeaksNoSecret

func AssertNotifyLeaksNoSecret(t *testing.T, ctx context.Context, n notify.Notifier, secret ...string)

AssertNotifyLeaksNoSecret calls the Notify() method of the notifier, expects it to fail because the context is canceled by the server and checks that no secret data is leaked in the error message returned by Notify().

func CreateTmpl

func CreateTmpl(t *testing.T) *template.Template

CreateTmpl returns a ready-to-use template.

func DefaultRetryCodes

func DefaultRetryCodes() []int

DefaultRetryCodes returns the list of HTTP status codes that need to be retried.

func GetContextWithCancelingURL

func GetContextWithCancelingURL(h ...func(w http.ResponseWriter, r *http.Request)) (context.Context, *url.URL, func())

GetContextWithCancelingURL returns a context that gets canceled when a client does a GET request to the returned URL. Handlers passed to the function will be invoked in order before the context gets canceled. The last argument is a function that needs to be called before the caller returns.

func RetryTests

func RetryTests(retryCodes []int) map[int]bool

RetryTests returns a map of HTTP status codes to bool indicating whether the notifier should retry or not.

Types

This section is empty.

Jump to

Keyboard shortcuts

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