test

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 8 Imported by: 0

README

test

Helper functions for testing Echo based Http services

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextAndRecorderGet

func ContextAndRecorderGet(path string, e *echo.Echo) (echo.Context, *httptest.ResponseRecorder)

ContextAndRecorderGet context and recorder for Get method

func ContextAndRecorderPost

func ContextAndRecorderPost(path, file string, e *echo.Echo) (echo.Context, *httptest.ResponseRecorder)

ContextAndRecorderPost context and recorder Put method

func ContextAndRecorderPut

func ContextAndRecorderPut(path, file string, e *echo.Echo) (echo.Context, *httptest.ResponseRecorder)

ContextAndRecorderPut context and recorder Put method

func HTTPResponse200

func HTTPResponse200(body string, req *http.Request) *http.Response

HTTPResponse200 return http response with status code 200

func HTTPResponse201

func HTTPResponse201(body string, req *http.Request) *http.Response

HTTPResponse201 return http response with status code 201

func HTTPResponse400

func HTTPResponse400(body string, req *http.Request) *http.Response

HTTPResponse400 return http response with status code 400

func HTTPResponse402

func HTTPResponse402(body string, req *http.Request) *http.Response

HTTPResponse402 return http response with status code 402

func HTTPResponse403

func HTTPResponse403(body string, req *http.Request) *http.Response

HTTPResponse403 return http response with status code 403

func HTTPResponse422

func HTTPResponse422(body string, req *http.Request) *http.Response

HTTPResponse422 return http response with status code 422

func HTTPResponse500

func HTTPResponse500(body string, req *http.Request) *http.Response

HTTPResponse500 return http response with status code 500

func Read

func Read(file string) string

Read reads json data from file

func RemoveEnterAndTabs

func RemoveEnterAndTabs(s string) string

RemoveEnterAndTabs removes enters and tabs

Types

This section is empty.

Jump to

Keyboard shortcuts

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