mock

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2017 License: GPL-3.0 Imports: 8 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 echo.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 (*Server) Execute

func (s *Server) Execute(handler app.HandlerFunc) (int, *jsonq.JsonQuery)

Execute given handler and return response as JSON

func (*Server) ExecutePost

func (s *Server) ExecutePost(handler app.HandlerFunc, body string) (int, *jsonq.JsonQuery)

ExecutePost executes given handler with posted JSON

func (*Server) ExecuteRaw

func (s *Server) ExecuteRaw(handler app.HandlerFunc) (int, *http.Response)

ExecuteRaw executes given handler and return raw response

func (*Server) NewContext

func (s *Server) NewContext(req *http.Request, w http.ResponseWriter) app.Context

NewContext creates a new HTTP context

Jump to

Keyboard shortcuts

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