Documentation ¶
Overview ¶
Package test mock executor heavily inspired from the Executor from github.com/rook/rook/pkg/util/exec pkg#
Index ¶
- type MockExecutor
- func (ce MockExecutor) ExecuteCommand(ctx context.Context, actionName string, command string, arg ...string) error
- func (ce MockExecutor) ExecuteCommandWithOutput(ctx context.Context, actionName string, command string, arg ...string) (string, error)
- func (ce MockExecutor) ExecuteCommandWithOutputByte(ctx context.Context, actionName string, command string, arg ...string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockExecutor ¶
type MockExecutor struct { executor.Executor MockExecuteCommand func(ctx context.Context, actionName string, command string, arg ...string) error MockExecuteCommandWithOutput func(ctx context.Context, actionName string, command string, arg ...string) (string, error) MockExecuteCommandWithOutputByte func(ctx context.Context, actionName string, command string, arg ...string) ([]byte, error) }
MockExecutor Mock Executor implementation for tests
func (MockExecutor) ExecuteCommand ¶
func (ce MockExecutor) ExecuteCommand(ctx context.Context, actionName string, command string, arg ...string) error
ExecuteCommand execute a given command with its arguments but don't return any output
func (MockExecutor) ExecuteCommandWithOutput ¶
func (ce MockExecutor) ExecuteCommandWithOutput(ctx context.Context, actionName string, command string, arg ...string) (string, error)
ExecuteCommandWithOutput execute a given command with its arguments and return the output as a string
func (MockExecutor) ExecuteCommandWithOutputByte ¶
func (ce MockExecutor) ExecuteCommandWithOutputByte(ctx context.Context, actionName string, command string, arg ...string) ([]byte, error)
ExecuteCommandWithOutputByte execute a given command with its arguments and return the output as a byte array ([]byte)
Click to show internal directories.
Click to hide internal directories.