Files
docker-cli/cli/command/task/client_test.go
Sebastiaan van Stijn 4f7c07cfc2 update local code for updated modules
Some tests had to be skipped as there's some issues to address, and
some of the result-types cannot be mocked / stubbed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-24 10:28:54 +02:00

28 lines
818 B
Go

package task
import (
"context"
"github.com/moby/moby/client"
)
type fakeClient struct {
client.APIClient
nodeInspectFunc func(ref string) (client.NodeInspectResult, error)
serviceInspectFunc func(ref string, options client.ServiceInspectOptions) (client.ServiceInspectResult, error)
}
func (cli *fakeClient) NodeInspect(_ context.Context, ref string, _ client.NodeInspectOptions) (client.NodeInspectResult, error) {
if cli.nodeInspectFunc != nil {
return cli.nodeInspectFunc(ref)
}
return client.NodeInspectResult{}, nil
}
func (cli *fakeClient) ServiceInspect(_ context.Context, ref string, options client.ServiceInspectOptions) (client.ServiceInspectResult, error) {
if cli.serviceInspectFunc != nil {
return cli.serviceInspectFunc(ref, options)
}
return client.ServiceInspectResult{}, nil
}