From a1af6e261f61668fb213f04994c6e32934ce2ae3 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Sirot Date: Thu, 7 Mar 2019 15:35:11 +0100 Subject: [PATCH] Cover the changes with unit test Signed-off-by: Jean-Christophe Sirot --- cli/command/cli_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cli/command/cli_test.go b/cli/command/cli_test.go index 0bbe6df055..926d43f2dd 100644 --- a/cli/command/cli_test.go +++ b/cli/command/cli_test.go @@ -295,3 +295,12 @@ func TestNewDockerCliAndOperators(t *testing.T) { assert.NilError(t, err) assert.Equal(t, string(errStream), "error") } + +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() + }))) + assert.Check(t, cli.ContextStore() != nil) +}