mock

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Context web.Context
	// contains filtered or unexported fields
}

Server is a HTTP server wrapper for testing purpose

func NewServer

func NewServer() *Server

NewServer creates a new test server

func NewSingleTenantServer

func NewSingleTenantServer() *Server

NewSingleTenantServer creates a new multitenant test server

func (*Server) Execute

func (s *Server) Execute(handler web.HandlerFunc) (int, *httptest.ResponseRecorder)

Execute given handler and return response

func (*Server) ExecuteAsJSON

func (s *Server) ExecuteAsJSON(handler web.HandlerFunc) (int, *jsonq.JsonQuery)

ExecuteAsJSON given handler and return json response

func (*Server) ExecutePost

func (s *Server) ExecutePost(handler web.HandlerFunc, body string) (int, *httptest.ResponseRecorder)

ExecutePost executes given handler as POST and return response

func (*Server) Use

func (s *Server) Use(middleware web.MiddlewareFunc)

Use adds a new middleware to pipeline

Jump to

Keyboard shortcuts

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