mock

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package mock provides functionalities for mocking testcontainers-go.

Index

Constants

This section is empty.

Variables

View Source
var NopContainer = MockContainer()

NopContainer is no mock Container.

Functions

This section is empty.

Types

type Container

type Container struct {
	mock.Mock
}

Container is an autogenerated mock type for the Container type

func NewContainer added in v0.7.0

func NewContainer(t interface {
	mock.TestingT
	Cleanup(func())
}) *Container

NewContainer creates a new instance of Container. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*Container) ContainerIP

func (_m *Container) ContainerIP(_a0 context.Context) (string, error)

ContainerIP provides a mock function with given fields: _a0

func (*Container) ContainerIPs added in v0.7.0

func (_m *Container) ContainerIPs(_a0 context.Context) ([]string, error)

ContainerIPs provides a mock function with given fields: _a0

func (*Container) CopyDirToContainer added in v0.6.0

func (_m *Container) CopyDirToContainer(ctx context.Context, hostDirPath string, containerParentPath string, fileMode int64) error

CopyDirToContainer provides a mock function with given fields: ctx, hostDirPath, containerParentPath, fileMode

func (*Container) CopyFileFromContainer

func (_m *Container) CopyFileFromContainer(ctx context.Context, filePath string) (io.ReadCloser, error)

CopyFileFromContainer provides a mock function with given fields: ctx, filePath

func (*Container) CopyFileToContainer

func (_m *Container) CopyFileToContainer(ctx context.Context, hostFilePath string, containerFilePath string, fileMode int64) error

CopyFileToContainer provides a mock function with given fields: ctx, hostFilePath, containerFilePath, fileMode

func (*Container) CopyToContainer

func (_m *Container) CopyToContainer(ctx context.Context, fileContent []byte, containerFilePath string, fileMode int64) error

CopyToContainer provides a mock function with given fields: ctx, fileContent, containerFilePath, fileMode

func (*Container) Endpoint

func (_m *Container) Endpoint(_a0 context.Context, _a1 string) (string, error)

Endpoint provides a mock function with given fields: _a0, _a1

func (*Container) Exec

func (_m *Container) Exec(ctx context.Context, cmd []string, options ...exec.ProcessOption) (int, io.Reader, error)

Exec provides a mock function with given fields: ctx, cmd, options

func (*Container) FollowOutput

func (_m *Container) FollowOutput(_a0 testcontainers.LogConsumer)

FollowOutput provides a mock function with given fields: _a0

func (*Container) GetContainerID

func (_m *Container) GetContainerID() string

GetContainerID provides a mock function with given fields:

func (*Container) GetLogProductionErrorChannel added in v0.13.0

func (_m *Container) GetLogProductionErrorChannel() <-chan error

GetLogProductionErrorChannel provides a mock function with given fields:

func (*Container) Host

func (_m *Container) Host(_a0 context.Context) (string, error)

Host provides a mock function with given fields: _a0

func (*Container) Inspect added in v0.14.0

func (_m *Container) Inspect(_a0 context.Context) (*types.ContainerJSON, error)

Inspect provides a mock function with given fields: _a0

func (*Container) IsRunning added in v0.6.0

func (_m *Container) IsRunning() bool

IsRunning provides a mock function with given fields:

func (*Container) Logs

func (_m *Container) Logs(_a0 context.Context) (io.ReadCloser, error)

Logs provides a mock function with given fields: _a0

func (*Container) MappedPort

func (_m *Container) MappedPort(_a0 context.Context, _a1 nat.Port) (nat.Port, error)

MappedPort provides a mock function with given fields: _a0, _a1

func (*Container) Name

func (_m *Container) Name(_a0 context.Context) (string, error)

Name provides a mock function with given fields: _a0

func (*Container) NetworkAliases

func (_m *Container) NetworkAliases(_a0 context.Context) (map[string][]string, error)

NetworkAliases provides a mock function with given fields: _a0

func (*Container) Networks

func (_m *Container) Networks(_a0 context.Context) ([]string, error)

Networks provides a mock function with given fields: _a0

func (*Container) PortEndpoint

func (_m *Container) PortEndpoint(_a0 context.Context, _a1 nat.Port, _a2 string) (string, error)

PortEndpoint provides a mock function with given fields: _a0, _a1, _a2

func (*Container) Ports

func (_m *Container) Ports(_a0 context.Context) (nat.PortMap, error)

Ports provides a mock function with given fields: _a0

func (*Container) SessionID

func (_m *Container) SessionID() string

SessionID provides a mock function with given fields:

func (*Container) Start

func (_m *Container) Start(_a0 context.Context) error

Start provides a mock function with given fields: _a0

func (*Container) StartLogProducer

func (_m *Container) StartLogProducer(_a0 context.Context, _a1 ...testcontainers.LogProductionOption) error

StartLogProducer provides a mock function with given fields: _a0, _a1

func (*Container) State

func (_m *Container) State(_a0 context.Context) (*types.ContainerState, error)

State provides a mock function with given fields: _a0

func (*Container) Stop

func (_m *Container) Stop(_a0 context.Context, _a1 *time.Duration) error

Stop provides a mock function with given fields: _a0, _a1

func (*Container) StopLogProducer

func (_m *Container) StopLogProducer() error

StopLogProducer provides a mock function with given fields:

func (*Container) Terminate

func (_m *Container) Terminate(ctx context.Context) error

Terminate provides a mock function with given fields: ctx

type ContainerMocker

type ContainerMocker func(tb testing.TB) *Container

ContainerMocker is Container mocker.

func MockContainer

func MockContainer(mocks ...func(c *Container)) ContainerMocker

MockContainer creates Container mock with cleanup to ensure all the expectations are met. nolint: revive

Directories

Path Synopsis
Package wait provides functionalities for mocking testcontainers-go/wait.
Package wait provides functionalities for mocking testcontainers-go/wait.

Jump to

Keyboard shortcuts

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