Documentation ¶
Index ¶
- Constants
- func IntPointer(i int) *int
- func InvalidToken(t *testing.T, a *auth.Auth) string
- func NewAuth(t *testing.T) *auth.Auth
- func NewUnit(t *testing.T, c *docker.Container, dbName string, data Data) (*zap.SugaredLogger, driver.Database, func())
- func StartDB() (*docker.Container, error)
- func StopDB(c *docker.Container)
- func StringPointer(s string) *string
- type Data
- type Test
Constants ¶
const ( Success = "\u2713" Failed = "\u2717" )
Variables ¶
This section is empty.
Functions ¶
func IntPointer ¶
IntPointer is a helper to get a *int from a int. It is in the tests package because we normally don't want to deal with pointers to basic types but it's useful in some tests.
func InvalidToken ¶
Invalid Token generates an invaid token signed by wrong key.
func NewUnit ¶
func NewUnit(t *testing.T, c *docker.Container, dbName string, data Data) (*zap.SugaredLogger, driver.Database, func())
NewUnit creates a test database inside a Docker container. It creates the required table structure but the database is otherwise empty. It returns the database to use as well as a function to call at the end of the test.
func StringPointer ¶
StringPointer is a helper to get a *string from a string. It is in the tests package because we normally don't want to deal with pointers to basic types but it's useful in some tests.
Types ¶
type Test ¶
type Test struct { DB driver.Database Log *zap.SugaredLogger Auth *auth.Auth Teardown func() // contains filtered or unexported fields }
Test owns state for running and shutting down tests.
func NewIntegration ¶
NewIntegration creates a database, seeds it, constructs an authenticator.