From b375006c3ef69218cfdd830b1c700a87fc4d3166 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 1 Oct 2025 10:12:11 +0200 Subject: [PATCH] cli/command: don't use WithInitializeClient in test It's just a wrapper around WithAPIClient, and not needed for this test, which validates that "Initialize" properly creates the context store, even if a client was already set; 3b26cfce8b7af1073b28bb78eb185a0689dbfcbf Signed-off-by: Sebastiaan van Stijn --- cli/command/cli_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/command/cli_test.go b/cli/command/cli_test.go index 29f8c3e7a..3fea15575 100644 --- a/cli/command/cli_test.go +++ b/cli/command/cli_test.go @@ -289,9 +289,9 @@ func TestNewDockerCliAndOperators(t *testing.T) { func TestInitializeShouldAlwaysCreateTheContextStore(t *testing.T) { cli, err := NewDockerCli() assert.NilError(t, err) - assert.NilError(t, cli.Initialize(flags.NewClientOptions(), WithInitializeClient(func(cli *DockerCli) (client.APIClient, error) { - return client.NewClientWithOpts() - }))) + apiClient, err := client.NewClientWithOpts() + assert.NilError(t, err) + assert.NilError(t, cli.Initialize(flags.NewClientOptions(), WithAPIClient(apiClient))) assert.Check(t, cli.ContextStore() != nil) }