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

Function Test_gpgKeyUploadScopesMissing

pkg/cmd/gpg-key/add/add_test.go:18–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

16)
17
18func Test_gpgKeyUploadScopesMissing(t *testing.T) {
19 reg := &httpmock.Registry{}
20 defer reg.Verify(t)
21 reg.Register(
22 httpmock.REST("POST", "user/gpg_keys"),
23 httpmock.StatusStringResponse(http.StatusNotFound, `{"message":"Not Found"}`),
24 )
25
26 err := gpgKeyUpload(&http.Client{Transport: reg}, "github.com", strings.NewReader("-----BEGIN PGP PUBLIC KEY BLOCK-----"), "")
27
28 require.Same(t, errScopesMissing, err)
29}
30
31func Test_gpgKeyUploadDuplicateKeyBeforeWrongFormat(t *testing.T) {
32 reg := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 5

VerifyMethod · 0.95
RegisterMethod · 0.95
RESTFunction · 0.92
StatusStringResponseFunction · 0.92
gpgKeyUploadFunction · 0.85

Tested by

no test coverage detected