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

Function TestUpdateDockerOnly

cli/command/context/update_test.go:33–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

31}
32
33func TestUpdateDockerOnly(t *testing.T) {
34 cli := makeFakeCli(t)
35 createTestContext(t, cli, "test", nil)
36 assert.NilError(t, runUpdate(cli, "test", updateOptions{
37 endpoint: map[string]string{
38 keyHost: "tcp://some-host",
39 },
40 }))
41 c, err := cli.ContextStore().GetMetadata("test")
42 assert.NilError(t, err)
43 dc, err := command.GetDockerContext(c)
44 assert.NilError(t, err)
45 assert.Equal(t, dc.Description, "description of test")
46 assert.Check(t, is.Contains(c.Endpoints, docker.DockerEndpoint))
47 assert.Equal(t, c.Endpoints[docker.DockerEndpoint].(docker.EndpointMeta).Host, "tcp://some-host")
48}
49
50func TestUpdateInvalidDockerHost(t *testing.T) {
51 cli := makeFakeCli(t)

Callers

nothing calls this directly

Calls 6

makeFakeCliFunction · 0.85
createTestContextFunction · 0.85
ContainsMethod · 0.80
runUpdateFunction · 0.70
GetMetadataMethod · 0.65
ContextStoreMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…