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

Function TestGetEngineSecretDescription

pkg/cli/engine_secrets_test.go:227–260  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

225}
226
227func TestGetEngineSecretDescription(t *testing.T) {
228 tests := []struct {
229 name string
230 engineValue string
231 wantContains string
232 }{
233 {
234 name: "copilot engine description",
235 engineValue: string(constants.CopilotEngine),
236 wantContains: "Fine-grained PAT",
237 },
238 {
239 name: "claude engine description",
240 engineValue: string(constants.ClaudeEngine),
241 wantContains: "Anthropic Console",
242 },
243 {
244 name: "codex engine description",
245 engineValue: string(constants.CodexEngine),
246 wantContains: "OpenAI",
247 },
248 }
249
250 for _, tt := range tests {
251 t.Run(tt.name, func(t *testing.T) {
252 opt := constants.GetEngineOption(tt.engineValue)
253 require.NotNil(t, opt, "Engine option should exist for %s", tt.engineValue)
254
255 desc := getEngineSecretDescription(opt)
256 assert.Contains(t, desc, tt.wantContains,
257 "Description should contain %q", tt.wantContains)
258 })
259 }
260}
261
262func TestSecretRequirementStructure(t *testing.T) {
263 t.Run("SecretRequirement has all required fields", func(t *testing.T) {

Callers

nothing calls this directly

Calls 3

GetEngineOptionFunction · 0.92
RunMethod · 0.45

Tested by

no test coverage detected