testutils

package
v0.0.0-...-9351e39 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB = pass.DB{
	Host:     "localhost",
	User:     "benoit",
	Password: "dummy",
	Name:     "isyro_prod",
}

DB is a test DB, usually build from importing the current production DB.

Functions

func Assert

func Assert(t *testing.T, b bool)

func AssertNoErr

func AssertNoErr(t *testing.T, err error)

func GenerateLatex

func GenerateLatex(t *testing.T, body string, outFile string)

GenerateLatex create a document, fill it with [body] and compile the latex code to create [outFile]

func ReadEnv

func ReadEnv(filename string) map[string]string

ReadEnv read [filename] and return its environnement variables.

func ShouldPanic

func ShouldPanic(t *testing.T, f func())

func WebsocketURL

func WebsocketURL(s string) string

WebsocketURL transforms `s` to set `ws` as scheme It panics on error.

Types

type TestDB

type TestDB struct {
	*sql.DB
	// contains filtered or unexported fields
}

func NewTestDB

func NewTestDB(t *testing.T, generateSQLFile ...string) TestDB

NewTestDB creates a new database and add all the tables as defined in the `generateSQLFile` files.

func (TestDB) Remove

func (db TestDB) Remove()

Remove closes the connection and remove the DB.

Jump to

Keyboard shortcuts

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