MCPcopy Create free account
hub / github.com/cli/cli / Test_userKeysScopesMissing

Function Test_userKeysScopesMissing

pkg/cmd/gpg-key/list/list_test.go:20–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

18)
19
20func 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
34func Test_userKeysHTTPError(t *testing.T) {
35 reg := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 5

VerifyMethod · 0.95
RegisterMethod · 0.95
QueryMatcherFunction · 0.92
StatusStringResponseFunction · 0.92
userKeysFunction · 0.85

Tested by

no test coverage detected