MCPcopy
hub / github.com/cli/cli / Test_getCallbackURI

Function Test_getCallbackURI

internal/authflow/flow_test.go:46–73  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

44}
45
46func Test_getCallbackURI(t *testing.T) {
47 tests := []struct {
48 name string
49 oauthHost string
50 want string
51 }{
52 {
53 name: "dotcom",
54 oauthHost: "github.com",
55 want: "http://127.0.0.1/callback",
56 },
57 {
58 name: "ghes",
59 oauthHost: "my.server.com",
60 want: "http://localhost/",
61 },
62 {
63 name: "ghec data residency (ghe.com)",
64 oauthHost: "stampname.ghe.com",
65 want: "http://127.0.0.1/callback",
66 },
67 }
68 for _, tt := range tests {
69 t.Run(tt.name, func(t *testing.T) {
70 assert.Equal(t, tt.want, getCallbackURI(tt.oauthHost))
71 })
72 }
73}

Callers

nothing calls this directly

Calls 3

getCallbackURIFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected