MCPcopy Index your code
hub / github.com/docker/cli / TestDefaultContextInitializer

Function TestDefaultContextInitializer

cli/command/defaultcontextstore_test.go:57–72  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55}
56
57func TestDefaultContextInitializer(t *testing.T) {
58 cli, err := NewDockerCli()
59 assert.NilError(t, err)
60 t.Setenv("DOCKER_HOST", "ssh://someswarmserver")
61 cli.configFile = &configfile.ConfigFile{}
62 ctx, err := resolveDefaultContext(&cliflags.ClientOptions{
63 TLS: true,
64 TLSOptions: &tlsconfig.Options{
65 CAFile: "./testdata/ca.pem",
66 },
67 }, DefaultContextStoreConfig())
68 assert.NilError(t, err)
69 assert.Equal(t, "default", ctx.Meta.Name)
70 assert.DeepEqual(t, "ssh://someswarmserver", ctx.Meta.Endpoints[docker.DockerEndpoint].(docker.EndpointMeta).Host)
71 golden.Assert(t, string(ctx.TLS.Endpoints[docker.DockerEndpoint].Files["ca.pem"]), "ca.pem")
72}
73
74func TestExportDefaultImport(t *testing.T) {
75 file1 := make([]byte, 1500)

Callers

nothing calls this directly

Calls 3

NewDockerCliFunction · 0.85
resolveDefaultContextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…