test

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2017 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DBDriver string
)

DBDriver is exported for testing purpose

Functions

func AuthHeaders

func AuthHeaders(t *testing.T, u *sdk.User, pass string) http.Header

func AuthentifyRequest

func AuthentifyRequest(t *testing.T, req *http.Request, u *sdk.User, pass string)

AuthentifyRequest have to be used only for tests

func AuthentifyRequestFromWorker

func AuthentifyRequestFromWorker(t *testing.T, req *http.Request, w *sdk.Worker)

AuthentifyRequestFromWorker have to be used only for tests

func DeleteTestProject

func DeleteTestProject(t *testing.T, db database.QueryExecuter, key string) error

DeleteTestProject delete a test project

func InsertAdminUser

func InsertAdminUser(t *testing.T, db *sql.DB) (*sdk.User, string)

InsertAdminUser have to be used only for tests

func InsertLambaUser

func InsertLambaUser(t *testing.T, db database.QueryExecuter, groups ...*sdk.Group) (*sdk.User, string)

InsertLambaUser have to be used only for tests

func InsertTestProject

func InsertTestProject(t *testing.T, db database.QueryExecuter, key, name string) *sdk.Project

InsertTestProject create a test project

func NewAuthentifiedRequest

func NewAuthentifiedRequest(t *testing.T, u *sdk.User, pass, method, uri string, i interface{}) *http.Request

NewAuthentifiedRequest prepare a request

func NewAuthentifiedRequestFromWorker

func NewAuthentifiedRequestFromWorker(t *testing.T, w *sdk.Worker, method, uri string, i interface{}) *http.Request

NewAuthentifiedRequestFromWorker prepare a request

func NoError

func NoError(t *testing.T, err error, msg ...interface{})

func NotEmpty

func NotEmpty(t *testing.T, i interface{}, msg ...interface{})

func NotNil

func NotNil(t *testing.T, i interface{}, msg ...interface{})

func RandomString

func RandomString(t *testing.T, strlen int) string

RandomString have to be used only for tests

func SetupPG

func SetupPG(t *testing.T, bootstrapFunc ...bootstrap) *sql.DB

SetupPG setup PG DB for test

Types

This section is empty.

Jump to

Keyboard shortcuts

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