Documentation ¶
Overview ¶
Package servicetest provides functionality to help write tests for the Vanadium services.
Index ¶
Constants ¶
const ( // TODO(caprita): Set the timeout in a more principled manner. ExpectTimeout = 20 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func CreateShell ¶
CreateShell builds a new shell. Returns the shell and a cleanup function.
func CreateShellAndMountTable ¶
CreateShellAndMountTable builds a new shell and starts a root mount table. Returns the shell and a cleanup function. TODO(sadovsky): Use v23test.StartRootMountTable.
Types ¶
type Tape ¶
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.
func (*Tape) Play ¶
func (t *Tape) Play() []interface{}
Play returns the function call stimuli recorded to this Tape.
func (*Tape) Record ¶
func (t *Tape) Record(call interface{}) interface{}
Record stores a new function invocation in a Tape and returns the response for that function interface.
func (*Tape) Rewind ¶
func (t *Tape) Rewind()
Rewind resets the tape to the beginning so that it could be used again for further tests.
func (*Tape) SetResponses ¶
func (t *Tape) SetResponses(responses ...interface{})
SetResponses updates the Tape's associated responses.