test

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: BSD-3-Clause, ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Helper

type Helper struct {
	// contains filtered or unexported fields
}

func NewHelper

func NewHelper(t *testing.T) *Helper

func (*Helper) LoadFile

func (h *Helper) LoadFile(f string) []byte

func (*Helper) NewAPIServer

func (h *Helper) NewAPIServer(handler http.HandlerFunc) *httptest.Server

func (*Helper) NewClient

func (h *Helper) NewClient(host net.Addr) *api.Client

func (*Helper) NewHTTPNotFoundHandler

func (h *Helper) NewHTTPNotFoundHandler(content []byte, path string) http.HandlerFunc

Creates a http handler which explicit returns a 404 json error response for the given path with given content.

func (*Helper) NewHTTPTestHandler

func (h *Helper) NewHTTPTestHandler(content []byte, path string) http.HandlerFunc

Creates a http handler which returns a response with the given content on the given path path. Otherwise return 404 - not found.

Jump to

Keyboard shortcuts

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