mocks

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeClient

type FakeClient struct {
	ContainerListSuccess        bool
	ImageListSuccess            bool
	ImagePullSuccess            bool
	ContainerCreateSuccess      bool
	ContainerStartSuccess       bool
	ContainerInspectSuccess     bool
	CopyToContainerFn           func(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error
	ContainerStatPathSuccess    bool
	CopyFromContainerSuccess    bool
	ContainerExecCreateSuccess  bool
	ContainerExecAttachSuccess  bool
	ContainerExecInspectSuccess bool
	ContainerStopSuccess        bool
	ContainerRemoveSuccess      bool
}

FakeClient Docker mock

func (*FakeClient) ContainerCreate

func (fc *FakeClient) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (container.ContainerCreateCreatedBody, error)

ContainerCreate mock function

func (*FakeClient) ContainerExecAttach

func (fc *FakeClient) ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error)

ContainerExecAttach mock function

func (*FakeClient) ContainerExecCreate

func (fc *FakeClient) ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error)

ContainerExecCreate mock function

func (*FakeClient) ContainerExecInspect

func (fc *FakeClient) ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error)

ContainerExecInspect mock function

func (*FakeClient) ContainerInspect

func (fc *FakeClient) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)

ContainerInspect mock function

func (*FakeClient) ContainerList

func (fc *FakeClient) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error)

ContainerList mock function

func (*FakeClient) ContainerRemove

func (fc *FakeClient) ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error

ContainerRemove mock function

func (*FakeClient) ContainerStart

func (fc *FakeClient) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error

ContainerStart mock function

func (*FakeClient) ContainerStatPath

func (fc *FakeClient) ContainerStatPath(ctx context.Context, containerID, path string) (types.ContainerPathStat, error)

ContainerStatPath mock function

func (*FakeClient) ContainerStop

func (fc *FakeClient) ContainerStop(ctx context.Context, containerID string, timeout *time.Duration) error

ContainerStop mock function

func (*FakeClient) CopyFromContainer

func (fc *FakeClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error)

CopyFromContainer mock function

func (*FakeClient) CopyToContainer

func (fc *FakeClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error

CopyToContainer mock function

func (*FakeClient) ImageList

func (fc *FakeClient) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error)

ImageList mock function

func (*FakeClient) ImagePull

func (fc *FakeClient) ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error)

ImagePull mock function

type TestRunner

type TestRunner struct {
	HasProject  bool
	HasSetup    bool
	HasRun      bool
	HasFinished bool
}

TestRunner is a mock to test runner functionalities

func NewTestRunner

func NewTestRunner(c config.Project, cli *command.SauceCtlCli) (*TestRunner, error)

NewTestRunner creates a runner for unit testing purposes

func (*TestRunner) Run

func (r *TestRunner) Run() (int, error)

Run test

func (*TestRunner) RunProject added in v0.12.1

func (r *TestRunner) RunProject() (int, error)

RunProject pretends to run tests defined by config.Project.

func (*TestRunner) Setup

func (r *TestRunner) Setup() error

Setup testrun

func (*TestRunner) Teardown

func (r *TestRunner) Teardown(logDir string) error

Teardown test run

Jump to

Keyboard shortcuts

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