ansiblemock

package
v0.0.0-...-4a20579 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerExecution

type ContainerExecution struct {
	Cmd        []string
	Parameters *ansible.ContainerParameters
}

ContainerExecution is a helper for holding together executed Command and container parameters within single StartExecuteAndRemove execution.

func (*ContainerExecution) String

func (c *ContainerExecution) String() string

type MockContainerExecutor

type MockContainerExecutor struct {
	// contains filtered or unexported fields
}

MockContainerExecutor collects all executions that were called via Container Executor.

func NewMockContainerExecutor

func NewMockContainerExecutor(t *testing.T) *MockContainerExecutor

NewMockContainerExecutor returns new testing container executor.

func (*MockContainerExecutor) AssertAndClear

func (m *MockContainerExecutor) AssertAndClear(expectedExecutions []ContainerExecution)

AssertAndClear compares executed commands and parameters with expected executions and clears previously executed commands and parameters to start over.

func (*MockContainerExecutor) StartExecuteAndRemove

func (m *MockContainerExecutor) StartExecuteAndRemove(
	ctx context.Context, cp *ansible.ContainerParameters, cmd []string,
) error

StartExecuteAndRemove is a mocked method which saves executed command and parameters for future assertions.

Jump to

Keyboard shortcuts

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