Documentation
¶
Overview ¶
Package test contains useful functions used across tests.
Index ¶
- func AssertError(t *testing.T, err error) *xerror.Error
- func AssertStatusCode(t *testing.T, expectedStatusCode int, srv http.Handler, req *http.Request)
- func DebugLogger() xlog.Logger
- func DummyEchoContext() echo.Context
- func EchoContextMultipart(t *testing.T) echo.Context
- func ErrorLogger() xlog.Logger
- func GenerateDestination() string
- func HTMLFpaths(t *testing.T) []string
- func HTMLMultipartForm(t *testing.T, formValues map[string]string) (*bytes.Buffer, string)
- func InfoLogger() xlog.Logger
- func MarkdownFpaths(t *testing.T) []string
- func MarkdownMultipartForm(t *testing.T, formValues map[string]string) (*bytes.Buffer, string)
- func MergeFpaths(t *testing.T) []string
- func MergeMultipartForm(t *testing.T, formValues map[string]string) (*bytes.Buffer, string)
- func OfficeFpaths(t *testing.T) []string
- func OfficeMultipartForm(t *testing.T, formValues map[string]string) (*bytes.Buffer, string)
- func URLFpaths(t *testing.T) []string
- func URLMultipartForm(t *testing.T, formValues map[string]string) (*bytes.Buffer, string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertError ¶
AssertError validates that given error is of an instance of xerror.Error. If so, returns the instance of xerror.Error.
func AssertStatusCode ¶
AssertStatusCode checks if the given request returns the expected status code.
func DebugLogger ¶
DebugLogger creates a xlog.Logger with xlog.DebugLevel for our tests.
func DummyEchoContext ¶
func DummyEchoContext() echo.Context
DummyEchoContext creates a echo.Context without anything.
func EchoContextMultipart ¶
EchoContextMultipart creates a echo.Context with form files.
func ErrorLogger ¶
ErrorLogger creates a xlog.Logger with xlog.ErrorLevel for our tests.
func GenerateDestination ¶
func GenerateDestination() string
GenerateDestination simply generates a path for a resulting PDF file.
func HTMLFpaths ¶
HTMLFpaths return the paths of all files under "testdata/html" folder.
func HTMLMultipartForm ¶
HTMLMultipartForm returns the body for a multipart/form-data request with all files under "testdata/html" folder.
func InfoLogger ¶
InfoLogger creates a xlog.Logger with xlog.InfoLevel for our tests.
func MarkdownFpaths ¶
MarkdownFpaths return the paths of all files under "testdata/markdown" folder.
func MarkdownMultipartForm ¶
MarkdownMultipartForm returns the body for a multipart/form-data request with all files under "testdata/markdown" folder.
func MergeFpaths ¶
MergeFpaths return the paths of all files under "testdata/pdf" folder.
func MergeMultipartForm ¶
MergeMultipartForm returns the body for a multipart/form-data request with all files under "testdata/pdf" folder.
func OfficeFpaths ¶
OfficeFpaths return the paths of all files under "testdata/office" folder.
func OfficeMultipartForm ¶
OfficeMultipartForm returns the body for a multipart/form-data request with all files under "testdata/office" folder.
Types ¶
This section is empty.