tests

package
v5.2.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2018 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const AdminUser = "tat.integration.tests.admin"

AdminUser used for integration tests

Variables

This section is empty.

Functions

func DoRequest

func DoRequest(t *testing.T, r *http.Request) *httptest.ResponseRecorder

DoRequest executes request for tests

func FakeAuthHandler

func FakeAuthHandler(t *testing.T, username string, referer string, isAdmin bool, isSystem bool) gin.HandlerFunc

FakeAuthHandler initiliazes gin context for tests

func Handle

func Handle(t *testing.T, method, path string, handler ...gin.HandlerFunc)

Handle associates a method & path on an handler (h)

func Init

func Init(t *testing.T)

Init the test context with the database

func RandomString

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

RandomString have to be used only for tests

func Router

func Router(t *testing.T) *gin.RouterGroup

Router prepare a gin router for test purpose

func TATClient

func TATClient(t *testing.T, username string) *tat.Client

TATClient is a client

Types

This section is empty.

Jump to

Keyboard shortcuts

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