(t *testing.T)
| 16 | ) |
| 17 | |
| 18 | func 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 | |
| 31 | func Test_gpgKeyUploadDuplicateKeyBeforeWrongFormat(t *testing.T) { |
| 32 | reg := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected