MCPcopy Create free account
hub / github.com/github/gh-aw / TestNewDeployCommand_RegistersCoreFlags

Function TestNewDeployCommand_RegistersCoreFlags

pkg/cli/deploy_command_test.go:33–64  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

31}
32
33func TestNewDeployCommand_RegistersCoreFlags(t *testing.T) {
34 cmd := NewDeployCommand(func(string) error { return nil })
35 require.NotNil(t, cmd)
36
37 expectedFlags := []string{
38 "repo",
39 "org",
40 "repos",
41 "yes",
42 "name",
43 "engine",
44 "force",
45 "append",
46 "no-gitattributes",
47 "dir",
48 "no-stop-after",
49 "stop-after",
50 "no-security-scanner",
51 "cool-down",
52 }
53
54 for _, flagName := range expectedFlags {
55 t.Run(flagName, func(t *testing.T) {
56 flag := cmd.Flags().Lookup(flagName)
57 require.NotNil(t, flag, "expected flag %q to be registered", flagName)
58 })
59 }
60
61 repoFlag := cmd.Flags().Lookup("repo")
62 require.NotNil(t, repoFlag, "expected --repo flag to be registered")
63 assert.Contains(t, repoFlag.Usage, "required unless --org is provided")
64}
65
66func TestNewDeployCommand_CoolDownFlagUsageMatchesUpdate(t *testing.T) {
67 cmd := NewDeployCommand(func(string) error { return nil })

Callers

nothing calls this directly

Calls 2

NewDeployCommandFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected