testutil

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package testutil provides helpful functions for testing command controller.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSuccessResponseFromHandler

func GetSuccessResponseFromHandler(handler rest.Handler, requestBody io.Reader,
	path string) (*bytes.Buffer, error)

GetSuccessResponseFromHandler reads response from given http handle func. expects http status OK.

func LookupHandler

func LookupHandler(t *testing.T, op restOperation, path string) rest.Handler

LookupHandler looks up for handler for given path.

func SendRequestToHandler

func SendRequestToHandler(handler rest.Handler, requestBody io.Reader, path string) (*bytes.Buffer, int, error)

SendRequestToHandler reads response from given http handle func.

func VerifyError

func VerifyError(t *testing.T, expectedCode command.Code, expectedMsg string, data []byte)

VerifyError verifies given error in response.

Types

This section is empty.

Jump to

Keyboard shortcuts

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