MCPcopy Index your code
hub / github.com/github/github-mcp-server / newFakeGitHub

Function newFakeGitHub

internal/oauth/testutil_test.go:43–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

41}
42
43func newFakeGitHub(t *testing.T) *fakeGitHub {
44 t.Helper()
45 f := &fakeGitHub{
46 authToken: "gho_access",
47 deviceToken: "gho_device",
48 }
49
50 mux := http.NewServeMux()
51 mux.HandleFunc("/login/oauth/authorize", f.handleAuthorize)
52 mux.HandleFunc("/login/oauth/access_token", f.handleToken)
53 mux.HandleFunc("/login/device/code", f.handleDeviceCode)
54
55 f.Server = httptest.NewServer(mux)
56 t.Cleanup(f.Server.Close)
57 return f
58}
59
60func (f *fakeGitHub) endpoint() oauth2.Endpoint {
61 return oauth2.Endpoint{

Calls

no outgoing calls

Tested by

no test coverage detected