Cover the changes with unit test

Signed-off-by: Jean-Christophe Sirot <jean-christophe.sirot@docker.com>
This commit is contained in:
Jean-Christophe Sirot 2019-03-07 15:35:11 +01:00
parent 37fcaf7a29
commit a1af6e261f
1 changed files with 9 additions and 0 deletions

View File

@ -295,3 +295,12 @@ func TestNewDockerCliAndOperators(t *testing.T) {
assert.NilError(t, err) assert.NilError(t, err)
assert.Equal(t, string(errStream), "error") 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)
}