(t *testing.T)
| 18 | ) |
| 19 | |
| 20 | func Test_userKeysScopesMissing(t *testing.T) { |
| 21 | reg := &httpmock.Registry{} |
| 22 | defer reg.Verify(t) |
| 23 | reg.Register( |
| 24 | httpmock.QueryMatcher("GET", "user/gpg_keys", url.Values{"per_page": []string{"100"}}), |
| 25 | httpmock.StatusStringResponse(http.StatusNotFound, `{"message":"Not Found"}`), |
| 26 | ) |
| 27 | |
| 28 | keys, err := userKeys(&http.Client{Transport: reg}, "github.com", "") |
| 29 | |
| 30 | assert.Nil(t, keys) |
| 31 | require.Same(t, errScopes, err) |
| 32 | } |
| 33 | |
| 34 | func Test_userKeysHTTPError(t *testing.T) { |
| 35 | reg := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected