(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func 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 | } |
nothing calls this directly
no test coverage detected