webcontext_test

package
v0.0.0-...-930c492 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2014 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package that enables you to write unit tests that rely on a context.Context object.

Index

Constants

This section is empty.

Variables

View Source
var TestRequest *http.Request

TestRequest is the most recent test *http.Request object that was created and used in a WebContext.

View Source
var TestResponseWriter *http_test.TestResponseWriter

TestResponseWriter is the most recent testify/http/TestResponseWriter object that was used in the WebContext. It will contain the last response.

Functions

func MakeTestContext

func MakeTestContext() *webcontext.WebContext

MakeTestContext makes a *webcontext.WebContext (that can be used as a context.Context) that can be used for esting.

func MakeTestContextWithDetails

func MakeTestContextWithDetails(path, method string) *webcontext.WebContext

MakeTestContextWithDetails makes a *webcontext.WebContext with the specified path and HTTP Method.

func MakeTestContextWithFullDetails

func MakeTestContextWithFullDetails(path, method, body string) *webcontext.WebContext

MakeTestContextWithFullDetails makes a *webcontext.WebContext with the specified path, HTTP Method and body string.

func MakeTestContextWithPath

func MakeTestContextWithPath(path string) *webcontext.WebContext

MakeTestContextWithPath makes a *webcontext.WebContext for testing with the specified path.

webcontext_test.MakeTestContextWithPath("http://mysite.com/path/{var}?queryparam1=1")

Types

This section is empty.

Jump to

Keyboard shortcuts

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