(t *testing.T)
| 41 | } |
| 42 | |
| 43 | func 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 | |
| 60 | func (f *fakeGitHub) endpoint() oauth2.Endpoint { |
| 61 | return oauth2.Endpoint{ |
no outgoing calls
no test coverage detected