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

Function TestLogsCommandFlagDefaults

pkg/cli/logs_command_test.go:94–120  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

92}
93
94func TestLogsCommandFlagDefaults(t *testing.T) {
95 cmd := NewLogsCommand()
96 flags := cmd.Flags()
97
98 tests := []struct {
99 flagName string
100 defaultValue string
101 }{
102 {"start-date", ""},
103 {"end-date", ""},
104 {"engine", ""},
105 {"output", ".github/aw/logs"}, // Updated to match actual default
106 {"ref", ""},
107 {"after-run-id", "0"},
108 {"before-run-id", "0"},
109 {"repo", ""},
110 {"artifacts", "[usage]"},
111 }
112
113 for _, tt := range tests {
114 t.Run(tt.flagName, func(t *testing.T) {
115 flag := flags.Lookup(tt.flagName)
116 require.NotNil(t, flag, "Flag should exist: %s", tt.flagName)
117 assert.Equal(t, tt.defaultValue, flag.DefValue, "Default value should match for flag: %s", tt.flagName)
118 })
119 }
120}
121
122func TestLogsCommandBooleanFlags(t *testing.T) {
123 cmd := NewLogsCommand()

Callers

nothing calls this directly

Calls 2

NewLogsCommandFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected