Skip to content

WIP: test/cli: Use APIClient instead of Client #5181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/command/builder/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient
builderPruneFunc func(ctx context.Context, opts types.BuildCachePruneOptions) (*types.BuildCachePruneReport, error)
}

Expand Down
2 changes: 1 addition & 1 deletion cli/command/checkpoint/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient
checkpointCreateFunc func(container string, options checkpoint.CreateOptions) error
checkpointDeleteFunc func(container string, options checkpoint.DeleteOptions) error
checkpointListFunc func(container string, options checkpoint.ListOptions) ([]checkpoint.Summary, error)
Expand Down
2 changes: 1 addition & 1 deletion cli/command/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func TestNewAPIClientFromFlagsWithAPIVersionFromEnv(t *testing.T) {
}

type fakeClient struct {
client.Client
client.APIClient
pingFunc func() (types.Ping, error)
version string
negotiated bool
Expand Down
2 changes: 1 addition & 1 deletion cli/command/config/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient
configCreateFunc func(context.Context, swarm.ConfigSpec) (types.ConfigCreateResponse, error)
configInspectFunc func(context.Context, string) (swarm.Config, []byte, error)
configListFunc func(context.Context, types.ConfigListOptions) ([]swarm.Config, error)
Expand Down
2 changes: 1 addition & 1 deletion cli/command/container/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient
inspectFunc func(string) (types.ContainerJSON, error)
execInspectFunc func(execID string) (container.ExecInspect, error)
execCreateFunc func(containerID string, options container.ExecOptions) (types.IDResponse, error)
Expand Down
2 changes: 1 addition & 1 deletion cli/command/idresolver/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient
nodeInspectFunc func(string) (swarm.Node, []byte, error)
serviceInspectFunc func(string) (swarm.Service, []byte, error)
}
Expand Down
2 changes: 1 addition & 1 deletion cli/command/image/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient
imageTagFunc func(string, string) error
imageSaveFunc func(images []string) (io.ReadCloser, error)
imageRemoveFunc func(image string, options image.RemoveOptions) ([]image.DeleteResponse, error)
Expand Down
2 changes: 1 addition & 1 deletion cli/command/network/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient
networkCreateFunc func(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error)
networkConnectFunc func(ctx context.Context, networkID, container string, config *network.EndpointSettings) error
networkDisconnectFunc func(ctx context.Context, networkID, container string, force bool) error
Expand Down
2 changes: 1 addition & 1 deletion cli/command/node/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient
infoFunc func() (system.Info, error)
nodeInspectFunc func() (swarm.Node, []byte, error)
nodeListFunc func() ([]swarm.Node, error)
Expand Down
2 changes: 1 addition & 1 deletion cli/command/plugin/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient
pluginCreateFunc func(createContext io.Reader, createOptions types.PluginCreateOptions) error
pluginDisableFunc func(name string, disableOptions types.PluginDisableOptions) error
pluginEnableFunc func(name string, options types.PluginEnableOptions) error
Expand Down
2 changes: 1 addition & 1 deletion cli/command/registry/login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (
)

type fakeClient struct {
client.Client
client.APIClient
}

func (c fakeClient) Info(context.Context) (system.Info, error) {
Expand Down
2 changes: 1 addition & 1 deletion cli/command/secret/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient
secretCreateFunc func(context.Context, swarm.SecretSpec) (types.SecretCreateResponse, error)
secretInspectFunc func(context.Context, string) (swarm.Secret, []byte, error)
secretListFunc func(context.Context, types.SecretListOptions) ([]swarm.Secret, error)
Expand Down
2 changes: 1 addition & 1 deletion cli/command/service/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient
serviceInspectWithRawFunc func(ctx context.Context, serviceID string, options types.ServiceInspectOptions) (swarm.Service, []byte, error)
serviceUpdateFunc func(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (swarm.ServiceUpdateResponse, error)
serviceListFunc func(context.Context, types.ServiceListOptions) ([]swarm.Service, error)
Expand Down
2 changes: 1 addition & 1 deletion cli/command/stack/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient

version string

Expand Down
2 changes: 1 addition & 1 deletion cli/command/stack/swarm/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient

version string

Expand Down
2 changes: 1 addition & 1 deletion cli/command/swarm/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient
infoFunc func() (system.Info, error)
swarmInitFunc func() (string, error)
swarmInspectFunc func() (swarm.Swarm, error)
Expand Down
2 changes: 1 addition & 1 deletion cli/command/system/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient

version string
serverVersion func(ctx context.Context) (types.Version, error)
Expand Down
2 changes: 1 addition & 1 deletion cli/command/trust/inspect_pretty_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
// TODO(n4ss): remove common tests with the regular inspect command

type fakeClient struct {
client.Client
client.APIClient
}

func (c *fakeClient) Info(context.Context) (system.Info, error) {
Expand Down
2 changes: 1 addition & 1 deletion cli/command/volume/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

type fakeClient struct {
client.Client
client.APIClient
volumeCreateFunc func(volume.CreateOptions) (volume.Volume, error)
volumeInspectFunc func(volumeID string) (volume.Volume, error)
volumeListFunc func(filter filters.Args) (volume.ListResponse, error)
Expand Down
2 changes: 1 addition & 1 deletion cli/compose/convert/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ func TestConvertServiceConfigs(t *testing.T) {
}

type fakeClient struct {
client.Client
client.APIClient
secretListFunc func(types.SecretListOptions) ([]swarm.Secret, error)
configListFunc func(types.ConfigListOptions) ([]swarm.Config, error)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/docker/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ echo '{"SchemaVersion":"0.1.0","Vendor":"Docker Inc.","Version":"v0.6.3","ShortD
}

type fakeClient struct {
client.Client
client.APIClient
}

func (c *fakeClient) Ping(_ context.Context) (types.Ping, error) {
Expand Down
Loading