Documentation ¶
Overview ¶
Package testutils contains mocks that can be shared across tests for multiple packages
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MockExperimentRunner ¶
type MockExperimentRunner struct { *runner.Treatment // If WantErr is true, GetTreatmentForRequest() will return a non-nil error WantErr bool // If WantTimeout is true, GetTreatmentForRequest() will wait for the duration of // Timeout and return a non-nil error WantTimeout bool // Timeout to wait for Timeout time.Duration }
MockExperimentRunner is a mock implementation for the Planner interface
func (MockExperimentRunner) GetTreatmentForRequest ¶
func (mp MockExperimentRunner) GetTreatmentForRequest( http.Header, []byte, runner.GetTreatmentOptions, ) (*runner.Treatment, error)
GetTreatmentForRequest returns the experiment treatment provided when MockExperimentRunner is initialized with TestTreatment. If MockExperimentRunner.WantErr is true, GetTreatmentForRequest will return error.
Click to show internal directories.
Click to hide internal directories.