-
Notifications
You must be signed in to change notification settings - Fork 35
/
mock_test.go
67 lines (53 loc) · 2.08 KB
/
mock_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package main
import (
"context"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/api/types/volume"
"github.com/stretchr/testify/mock"
)
var _ dockerClient = (*mockClient)(nil)
type mockClient struct {
mock.Mock
}
func (c *mockClient) ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error) {
args := c.Called(ctx, options)
return args.Get(0).([]types.Container), args.Error(1)
}
func (c *mockClient) ContainerRemove(ctx context.Context, containerID string, options container.RemoveOptions) error {
args := c.Called(ctx, containerID, options)
return args.Error(0)
}
func (c *mockClient) ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error) {
args := c.Called(ctx, options)
return args.Get(0).([]image.Summary), args.Error(1)
}
func (c *mockClient) ImageRemove(ctx context.Context, imageID string, options image.RemoveOptions) ([]image.DeleteResponse, error) {
args := c.Called(ctx, imageID, options)
return args.Get(0).([]image.DeleteResponse), args.Error(1)
}
func (c *mockClient) NetworkList(ctx context.Context, options network.ListOptions) ([]network.Summary, error) {
args := c.Called(ctx, options)
return args.Get(0).([]network.Summary), args.Error(1)
}
func (c *mockClient) NetworkRemove(ctx context.Context, networkID string) error {
args := c.Called(ctx, networkID)
return args.Error(0)
}
func (c *mockClient) VolumeList(ctx context.Context, options volume.ListOptions) (volume.ListResponse, error) {
args := c.Called(ctx, options)
return args.Get(0).(volume.ListResponse), args.Error(1)
}
func (c *mockClient) VolumeRemove(ctx context.Context, volumeID string, force bool) error {
args := c.Called(ctx, volumeID, force)
return args.Error(0)
}
func (c *mockClient) Ping(ctx context.Context) (types.Ping, error) {
args := c.Called(ctx)
return args.Get(0).(types.Ping), args.Error(1)
}
func (c *mockClient) NegotiateAPIVersion(ctx context.Context) {
c.Called(ctx)
}