testutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package testutil contains helper functions for writing tests

Index

Constants

This section is empty.

Variables

View Source
var (

	// testutil.RootDir will point to wherever this project's root directory is located on the user's computer
	RootDir = filepath.Join(filepath.Dir(f), ".."+string(os.PathSeparator)+"..") + string(os.PathSeparator)
)

Functions

func ConvertResponseToRequest

func ConvertResponseToRequest(t *testing.T, w *httptest.ResponseRecorder) *http.Request

func Getenv

func Getenv(key string) string

func HasBody added in v0.1.0

func HasBody(w *httptest.ResponseRecorder) bool

func NewGet added in v0.1.0

func NewGet(path string, values url.Values) (*httptest.ResponseRecorder, *http.Request)

func NewPost added in v0.1.0

func NewPost(path string, values url.Values) (*httptest.ResponseRecorder, *http.Request)

func NewRequest added in v0.1.0

func NewRequest(path string, values url.Values) *http.Request

func ResponseOK added in v0.1.0

func ResponseOK(w *httptest.ResponseRecorder) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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