trustdbtest

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Timeout         = time.Second
	TestDataRelPath = "../trustdbtest/testdata"
)

Functions

func TestTrustDB

func TestTrustDB(t *testing.T, db TestableTrustDB)

TestTrustDB should be used to test any implementation of the TrustDB interface. An implementation of the TrustDB interface should at least have on test method that calls this test-suite. The calling test code should have a top level Convey block.

setup should return a TrustDB in a clean state, i.e. no entries in the DB. cleanup can be used to release any resources that have been allocated during setup.

Types

type TestableTrustDB

type TestableTrustDB interface {
	trustdb.TrustDB
	// Prepare should reset the internal state so that the db is empty and is ready to be tested.
	Prepare(*testing.T, context.Context)
}

TestableTrustDB extends the trust db interface with methods that are needed for testing.

Jump to

Keyboard shortcuts

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