Documentation ¶
Overview ¶
Package treetest implements fake Tree for testing in CV.
Index ¶
- type FakeServer
- func (fs *FakeServer) GetStatus(ctx context.Context, req *tspb.GetStatusRequest) (*tspb.Status, error)
- func (fs *FakeServer) Host() string
- func (fs *FakeServer) InjectErr(treeName string, err error)
- func (fs *FakeServer) ModifyState(treeName string, state tspb.GeneralState)
- func (fs *FakeServer) Shutdown()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeServer ¶
type FakeServer struct { tspb.UnimplementedTreeStatusServer // contains filtered or unexported fields }
FakeServer simulates tree status server used in test.
func NewFakeServer ¶
func NewFakeServer(ctx context.Context) *FakeServer
NewFakeServer returns a fake tree status server.
`Shutdown` SHOULD be called after test completes.
func (*FakeServer) GetStatus ¶
func (fs *FakeServer) GetStatus(ctx context.Context, req *tspb.GetStatusRequest) (*tspb.Status, error)
GetStatus implements `tspb.TreeStatusServer`.
func (*FakeServer) Host ¶
func (fs *FakeServer) Host() string
Host returns the address of fake tree status server.
func (*FakeServer) InjectErr ¶
func (fs *FakeServer) InjectErr(treeName string, err error)
InjectErr makes Tree status server return error for the given tree.
Passing nil error will bring the tree back to normal.
func (*FakeServer) ModifyState ¶
func (fs *FakeServer) ModifyState(treeName string, state tspb.GeneralState)
ModifyState sets the state of the given tree.
func (*FakeServer) Shutdown ¶
func (fs *FakeServer) Shutdown()
Shutdown closes the fake tree status server.
Click to show internal directories.
Click to hide internal directories.