Skip to content

Commit b375006

Browse files
committed
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; 3b26cfc Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 9c79528 commit b375006

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cli/command/cli_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ func TestNewDockerCliAndOperators(t *testing.T) {
289289
func TestInitializeShouldAlwaysCreateTheContextStore(t *testing.T) {
290290
cli, err := NewDockerCli()
291291
assert.NilError(t, err)
292-
assert.NilError(t, cli.Initialize(flags.NewClientOptions(), WithInitializeClient(func(cli *DockerCli) (client.APIClient, error) {
293-
return client.NewClientWithOpts()
294-
})))
292+
apiClient, err := client.NewClientWithOpts()
293+
assert.NilError(t, err)
294+
assert.NilError(t, cli.Initialize(flags.NewClientOptions(), WithAPIClient(apiClient)))
295295
assert.Check(t, cli.ContextStore() != nil)
296296
}
297297

0 commit comments

Comments
 (0)