import "v.io/x/ref/services/internal/servicetest"
Package servicetest provides functionality to help write tests for the Vanadium services.
doc.go mock.go modules.go timeouts.go
const ( // TODO(caprita): Set the timeout in a more principled manner. ExpectTimeout = 20 * time.Second )
CreateShell builds a new shell. Returns the shell and a cleanup function.
CreateShellAndMountTable builds a new shell and starts a root mount table. Returns the shell and a cleanup function. TODO(sadovsky): Use v23test.StartRootMountTable.
SetupRootDir sets up and returns a directory for the root and returns a cleanup function.
Tape holds a record of function call stimuli and each function call's response. Use Tape to help build a mock framework by first creating a new Tape, then SetResponses to define the mock responses and then Record each function invocation. Play returns the function invocations for verification in a test.
NewTape creates a new Tape.
Play returns the function call stimuli recorded to this Tape.
Record stores a new function invocation in a Tape and returns the response for that function interface.
Rewind resets the tape to the beginning so that it could be used again for further tests.
SetResponses updates the Tape's associated responses.
TapeMap provides multiple tapes for different strings. Use TapeMap to record separate Tapes for each suffix in a service.
NewTapeMap creates a new empty TapeMap.
ForSuffix returns the Tape for suffix s.
Rewind rewinds all of the Tapes in the TapeMap.
Package servicetest imports 20 packages (graph) and is imported by 2 packages. Updated 2020-09-08. Refresh now. Tools for package owners.