test

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyTestFile

func CopyTestFile(t *testing.T, dstDir, dstPrefix, src string) string

CopyTestFile copies the contents of a designated file to a temporary file and returns the filepath of the temporary file for cleanup. This function does NOT clean up created temporary files. Borrows from: https://opensource.com/article/18/6/copying-files-go

func NewContext

func NewContext(t *testing.T, method string, query string, r io.Reader, ctype string) (echo.Context, *httptest.ResponseRecorder)

NewContext returns a new echo.Context, and *httptest.ResponseRecorder to be used for tests.

func NewGenerator

func NewGenerator() token.Generator

NewGenerator returns a mock token generator.

func TruncateTables

func TruncateTables(t *testing.T, db *pg.DB)

TruncateTables truncates all of the tables in the database to be able to start from scratch for a test.

Types

This section is empty.

Jump to

Keyboard shortcuts

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