Documentation ¶
Overview ¶
Package test contains test helper functions dealing with a database.
Index ¶
- func DbWithTestTable() (*sql.DB, error)
- func EmptyReposAndSqlFile(setupfile string) (*dbrepo.Repos, func(), error)
- func ReposAndLoadFile(setupfile string) (*dbrepo.Repos, func(), error)
- func ReposEmpty() (*dbrepo.Repos, func(), error)
- func ReposEmptyInMemory() (*dbrepo.Repos, func(), error)
- func ReposEmptyTempFile() (*dbrepo.Repos, func(), error)
- type TestRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DbWithTestTable ¶
DbWIthTestTable creates a test database with one small table called test.
func EmptyReposAndSqlFile ¶
ReposAndSqlFile creates a test Repos and loads the specified SQL file. It does not create the standard tables.
func ReposAndLoadFile ¶
ReposAndLoadFile creates a test Repos with the default set of tables, then imports the specified JRaceman-format file.
func ReposEmpty ¶
ReposEmpty creates an empty test Repos. The second return value is the cleanup function. Tests should call this function to ensure that everything is properly cleaned up at the end of each test.
func ReposEmptyInMemory ¶
ReposEmptyInMemory create an empty in-memory Repos for use with unit tests.
func ReposEmptyTempFile ¶
ReposEmptyTempFile create an empty Repos database using a temp file for use with unit tests.