Documentation ¶
Index ¶
- type Fetcher
- func (mock *Fetcher) ContainerID() string
- func (mock *Fetcher) ContainerIDCalls() []struct{}
- func (mock *Fetcher) Exec(ctx context.Context, cmd ...string) ([]byte, error)
- func (mock *Fetcher) ExecCalls() []struct{ ... }
- func (mock *Fetcher) Log(ctx context.Context) (io.ReadCloser, error)
- func (mock *Fetcher) LogCalls() []struct{ ... }
- func (mock *Fetcher) Ports() nat.PortMap
- func (mock *Fetcher) PortsCalls() []struct{}
- func (mock *Fetcher) Status(ctx context.Context) (*types.ContainerState, error)
- func (mock *Fetcher) StatusCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fetcher ¶
type Fetcher struct { // ContainerIDFunc mocks the ContainerID method. ContainerIDFunc func() string // ExecFunc mocks the Exec method. ExecFunc func(ctx context.Context, cmd ...string) ([]byte, error) // LogFunc mocks the Log method. LogFunc func(ctx context.Context) (io.ReadCloser, error) // PortsFunc mocks the Ports method. PortsFunc func() nat.PortMap // StatusFunc mocks the Status method. StatusFunc func(ctx context.Context) (*types.ContainerState, error) // contains filtered or unexported fields }
Fetcher is a mock implementation of wait.Fetcher.
func TestSomethingThatUsesFetcher(t *testing.T) { // make and configure a mocked wait.Fetcher mockedFetcher := &Fetcher{ ContainerIDFunc: func() string { panic("mock out the ContainerID method") }, ExecFunc: func(ctx context.Context, cmd ...string) ([]byte, error) { panic("mock out the Exec method") }, LogFunc: func(ctx context.Context) (io.ReadCloser, error) { panic("mock out the Log method") }, PortsFunc: func() nat.PortMap { panic("mock out the Ports method") }, StatusFunc: func(ctx context.Context) (*types.ContainerState, error) { panic("mock out the Status method") }, } // use mockedFetcher in code that requires wait.Fetcher // and then make assertions. }
func (*Fetcher) ContainerID ¶ added in v0.4.0
ContainerID calls ContainerIDFunc.
func (*Fetcher) ContainerIDCalls ¶ added in v0.4.0
func (mock *Fetcher) ContainerIDCalls() []struct { }
ContainerIDCalls gets all the calls that were made to ContainerID. Check the length with:
len(mockedFetcher.ContainerIDCalls())
func (*Fetcher) ExecCalls ¶ added in v1.3.2
ExecCalls gets all the calls that were made to Exec. Check the length with:
len(mockedFetcher.ExecCalls())
func (*Fetcher) LogCalls ¶
LogCalls gets all the calls that were made to Log. Check the length with:
len(mockedFetcher.LogCalls())
func (*Fetcher) PortsCalls ¶
func (mock *Fetcher) PortsCalls() []struct { }
PortsCalls gets all the calls that were made to Ports. Check the length with:
len(mockedFetcher.PortsCalls())
func (*Fetcher) StatusCalls ¶
StatusCalls gets all the calls that were made to Status. Check the length with:
len(mockedFetcher.StatusCalls())
Click to show internal directories.
Click to hide internal directories.