mirror of https://github.com/docker/cli.git
Compare commits
2 Commits
71c17a07e0
...
5def101d77
Author | SHA1 | Date |
---|---|---|
Sebastiaan van Stijn | 5def101d77 | |
Sebastiaan van Stijn | 4430362a71 |
|
@ -19,7 +19,7 @@ type fakeClient struct {
|
||||||
client.Client
|
client.Client
|
||||||
|
|
||||||
version string
|
version string
|
||||||
containerListFunc func(context.Context, container.ListOptions) ([]container.Summary, error)
|
containerListFunc func(context.Context, container.ListOptions) ([]types.Container, error)
|
||||||
containerPruneFunc func(ctx context.Context, pruneFilters filters.Args) (container.PruneReport, error)
|
containerPruneFunc func(ctx context.Context, pruneFilters filters.Args) (container.PruneReport, error)
|
||||||
eventsFn func(context.Context, events.ListOptions) (<-chan events.Message, <-chan error)
|
eventsFn func(context.Context, events.ListOptions) (<-chan events.Message, <-chan error)
|
||||||
imageListFunc func(ctx context.Context, options image.ListOptions) ([]image.Summary, error)
|
imageListFunc func(ctx context.Context, options image.ListOptions) ([]image.Summary, error)
|
||||||
|
@ -35,11 +35,11 @@ func (cli *fakeClient) ClientVersion() string {
|
||||||
return cli.version
|
return cli.version
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cli *fakeClient) ContainerList(ctx context.Context, options container.ListOptions) ([]container.Summary, error) {
|
func (cli *fakeClient) ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error) {
|
||||||
if cli.containerListFunc != nil {
|
if cli.containerListFunc != nil {
|
||||||
return cli.containerListFunc(ctx, options)
|
return cli.containerListFunc(ctx, options)
|
||||||
}
|
}
|
||||||
return []container.Summary{}, nil
|
return []types.Container{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cli *fakeClient) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (container.PruneReport, error) {
|
func (cli *fakeClient) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (container.PruneReport, error) {
|
||||||
|
|
|
@ -27,8 +27,8 @@ func TestCompleteEventFilter(t *testing.T) {
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
client: &fakeClient{
|
client: &fakeClient{
|
||||||
containerListFunc: func(_ context.Context, _ container.ListOptions) ([]container.Summary, error) {
|
containerListFunc: func(_ context.Context, _ container.ListOptions) ([]types.Container, error) {
|
||||||
return []container.Summary{
|
return []types.Container{
|
||||||
*builders.Container("c1"),
|
*builders.Container("c1"),
|
||||||
*builders.Container("c2"),
|
*builders.Container("c2"),
|
||||||
}, nil
|
}, nil
|
||||||
|
@ -39,7 +39,7 @@ func TestCompleteEventFilter(t *testing.T) {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
client: &fakeClient{
|
client: &fakeClient{
|
||||||
containerListFunc: func(_ context.Context, _ container.ListOptions) ([]container.Summary, error) {
|
containerListFunc: func(_ context.Context, _ container.ListOptions) ([]types.Container, error) {
|
||||||
return nil, errors.New("API error")
|
return nil, errors.New("API error")
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue