dbtesting

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataStoreTestSuite

func DataStoreTestSuite(t *testing.T, env DbTestEnv)

DataStoreTestSuite combines all test suites for datastore testing.

func FileStoreTest

func FileStoreTest(t *testing.T, fs db.Store)

FileStoreTest tests a FileStore.

Types

type DbTestEnv

type DbTestEnv interface {
	// Creates the database testing environment. Called once per database test suite.
	Create() error
	// Cleans the database testing environment before every test and returns a new Store instance to be used by the test.
	Clean() (db.Store, error)
	// Destroys the database testing environment after all the tests have run. Called once per database test suite.
	Destroy() error
}

DbTestEnv has to be implemented for each datastore where data store tests are expected to run.

Jump to

Keyboard shortcuts

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