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

Function TestGetEffectiveCopilotGitHubToken

pkg/workflow/github_token_test.go:65–91  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestGetEffectiveCopilotGitHubToken(t *testing.T) {
66 tests := []struct {
67 name string
68 customToken string
69 expected string
70 }{
71 {
72 name: "custom token has highest precedence",
73 customToken: "${{ secrets.CUSTOM_COPILOT_TOKEN }}",
74 expected: "${{ secrets.CUSTOM_COPILOT_TOKEN }}",
75 },
76 {
77 name: "default fallback for Copilot",
78 customToken: "",
79 expected: "${{ secrets.COPILOT_GITHUB_TOKEN }}",
80 },
81 }
82
83 for _, tt := range tests {
84 t.Run(tt.name, func(t *testing.T) {
85 result := getEffectiveCopilotRequestsToken(tt.customToken)
86 if result != tt.expected {
87 t.Errorf("getEffectiveCopilotRequestsToken() = %q, want %q", result, tt.expected)
88 }
89 })
90 }
91}
92
93func TestGetEffectiveAgentGitHubToken(t *testing.T) {
94 tests := []struct {

Callers

nothing calls this directly

Calls 3

RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected