mocks

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PullPushIoMock

type PullPushIoMock struct {
	// LoadKustomizationFileFunc mocks the LoadKustomizationFile method.
	LoadKustomizationFileFunc func(kstPath string) ([]image.Image, error)

	// OpenDockerClientFunc mocks the OpenDockerClient method.
	OpenDockerClientFunc func() (docker_utils.DockerClient, error)
	// contains filtered or unexported fields
}

PullPushIoMock is a mock implementation of PullPushIo.

    func TestSomethingThatUsesPullPushIo(t *testing.T) {

        // make and configure a mocked PullPushIo
        mockedPullPushIo := &PullPushIoMock{
            LoadKustomizationFileFunc: func(kstPath string) ([]image.Image, error) {
	               panic("mock out the LoadKustomizationFile method")
            },
            OpenDockerClientFunc: func() (docker_utils.DockerClient, error) {
	               panic("mock out the OpenDockerClient method")
            },
        }

        // use mockedPullPushIo in code that requires PullPushIo
        // and then make assertions.

    }

func GetIoMocks

func GetIoMocks(is is.I) PullPushIoMock

GetIoMocks -- get mock implementation of PullPushIo

func (*PullPushIoMock) LoadKustomizationFile

func (mock *PullPushIoMock) LoadKustomizationFile(kstPath string) ([]image.Image, error)

LoadKustomizationFile calls LoadKustomizationFileFunc.

func (*PullPushIoMock) LoadKustomizationFileCalls

func (mock *PullPushIoMock) LoadKustomizationFileCalls() []struct {
	KstPath string
}

LoadKustomizationFileCalls gets all the calls that were made to LoadKustomizationFile. Check the length with:

len(mockedPullPushIo.LoadKustomizationFileCalls())

func (*PullPushIoMock) OpenDockerClient

func (mock *PullPushIoMock) OpenDockerClient() (docker_utils.DockerClient, error)

OpenDockerClient calls OpenDockerClientFunc.

func (*PullPushIoMock) OpenDockerClientCalls

func (mock *PullPushIoMock) OpenDockerClientCalls() []struct {
}

OpenDockerClientCalls gets all the calls that were made to OpenDockerClient. Check the length with:

len(mockedPullPushIo.OpenDockerClientCalls())

Jump to

Keyboard shortcuts

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