MCPcopy Index your code
hub / github.com/docker/docker-agent / TestIsManagementInvocation

Function TestIsManagementInvocation

cmd/root/selfupdate_test.go:11–39  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestIsManagementInvocation(t *testing.T) {
12 t.Parallel()
13
14 for _, args := range [][]string{
15 {metadata.MetadataSubcommandName},
16 {cobra.ShellCompRequestCmd},
17 {cobra.ShellCompNoDescRequestCmd},
18 {"completion", "bash"},
19 {"version"},
20 {"help"},
21 {"--help"},
22 {"-h"},
23 {"--version"},
24 {"run", "--help"},
25 {"run", "agent.yaml", "-h"},
26 {"share", "push", "--help"},
27 } {
28 assert.True(t, isManagementInvocation(args), "args %v", args)
29 }
30
31 for _, args := range [][]string{
32 nil,
33 {},
34 {"run", "agent.yaml"},
35 {"new"},
36 } {
37 assert.False(t, isManagementInvocation(args), "args %v", args)
38 }
39}

Callers

nothing calls this directly

Calls 1

isManagementInvocationFunction · 0.85

Tested by

no test coverage detected