Documentation ¶
Index ¶
- func NewExecutorMethodAnyCall(executor *cage_exec_mocks.Executor, method string, ctxType interface{}) *mock.Call
- func NewExecutorMethodAnyFail(executor *cage_exec_mocks.Executor, method string, ctx context.Context, ...) (_ *std_exec.Cmd, _ cage_exec.PipelineResult, newCmdCall, methodCall *mock.Call)
- func NewExecutorMethodAnyPass(executor *cage_exec_mocks.Executor, method string, ctx context.Context, ...) (_ *std_exec.Cmd, _ cage_exec.PipelineResult, newCmdCall, methodCall *mock.Call)
- func NewSingleCmdFailRes() (*std_exec.Cmd, cage_exec.PipelineResult)
- func NewSingleCmdPassRes() (*std_exec.Cmd, cage_exec.PipelineResult)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewExecutorMethodAnyCall ¶
func NewExecutorMethodAnyCall(executor *cage_exec_mocks.Executor, method string, ctxType interface{}) *mock.Call
NewExecutorMethodAnyCall returns a mock Executor method call that can receive any arguments.
Example context type strings: "*context.timerCtx", "*context.emptyCtx=context.Background"
func NewExecutorMethodAnyFail ¶
func NewExecutorMethodAnyFail(executor *cage_exec_mocks.Executor, method string, ctx context.Context, ctxType interface{}, argsLen int) (_ *std_exec.Cmd, _ cage_exec.PipelineResult, newCmdCall, methodCall *mock.Call)
NewExecutorMethodAnyFail returns a mock call to an Executor method which is configured to return an error response.
It also returns the command, expected return values, Command/CommandContext's mock call, and the input method's mock call.
If the context is non-nil, Executor.CommandContext is used instead of Executor.Command.
func NewExecutorMethodAnyPass ¶
func NewExecutorMethodAnyPass(executor *cage_exec_mocks.Executor, method string, ctx context.Context, ctxType interface{}, argsLen int) (_ *std_exec.Cmd, _ cage_exec.PipelineResult, newCmdCall, methodCall *mock.Call)
NewExecutorMethodAnyPass returns a mock call to an Executor method which is configured to return a success response.
It also returns the command, expected return values, Command/CommandContext's mock call, and the input method's mock call.
If the context is non-nil, Executor.CommandContext is used instead of Executor.Command.
func NewSingleCmdFailRes ¶
func NewSingleCmdFailRes() (*std_exec.Cmd, cage_exec.PipelineResult)
NewSingleCmdFailRes returns a command a pipeline result initialized to describe an execution error.
It may simplify test case boilerplate when configuring a mock to return a failing result but the specifics (e.g. standard error content) can just be sane defaults.
It returns the command, in addition to the result, for easier access to the result because the former value is the only key of the result map.
func NewSingleCmdPassRes ¶
func NewSingleCmdPassRes() (*std_exec.Cmd, cage_exec.PipelineResult)
NewSingleCmdPassRes returns a command a pipeline result initialized to describe an execution success.
It may simplify test case boilerplate when configuring a mock to return a passing result but the specifics (e.g. standard error content) can just be sane defaults.
It returns the command, in addition to the result, for easier access to the result because the former value is the only key of the result map.
Types ¶
This section is empty.