exec

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2020 License: MPL-2.0, MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL