Documentation ¶
Overview ¶
Package clitesting contains utilities useful for testing clients and client components.
Index ¶
Constants ¶
View Source
const ( // MockCommTimeout is how long we wait for the test to accept messages // sent through MockServiceContext. MockCommTimeout = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockServiceContext ¶
type MockServiceContext struct { service.Context OutChan chan *fspb.Message StatsCollector stats.Collector }
MockServiceContext is a mock service.Context which allows a test to run a service without a full Fleetspeak client.
func (*MockServiceContext) Send ¶
func (sc *MockServiceContext) Send(ctx context.Context, m service.AckMessage) error
Send implements service.Context by copying the message to sc.OutChan.
func (*MockServiceContext) Stats ¶
func (sc *MockServiceContext) Stats() stats.Collector
Stats implements service.Context by returning the assigned stats.Collector or a NoopCollector if none was set.
Click to show internal directories.
Click to hide internal directories.