(t *testing.T)
| 70 | } |
| 71 | |
| 72 | func Test_verifyRun_Success(t *testing.T) { |
| 73 | ios, _, _, _ := iostreams.Test() |
| 74 | tagName := "v6" |
| 75 | |
| 76 | fakeHTTP := &httpmock.Registry{} |
| 77 | defer fakeHTTP.Verify(t) |
| 78 | |
| 79 | fakeSHA := "1234567890abcdef1234567890abcdef12345678" |
| 80 | shared.StubFetchRefSHA(t, fakeHTTP, "owner", "repo", tagName, fakeSHA) |
| 81 | |
| 82 | baseRepo, err := ghrepo.FromFullName("owner/repo") |
| 83 | require.NoError(t, err) |
| 84 | |
| 85 | result := &verification.AttestationProcessingResult{ |
| 86 | Attestation: &api.Attestation{ |
| 87 | Bundle: data.GitHubReleaseBundle(t), |
| 88 | BundleURL: "https://example.com", |
| 89 | }, |
| 90 | VerificationResult: nil, |
| 91 | } |
| 92 | |
| 93 | cfg := &VerifyConfig{ |
| 94 | Opts: &VerifyOptions{ |
| 95 | TagName: tagName, |
| 96 | BaseRepo: baseRepo, |
| 97 | Exporter: nil, |
| 98 | }, |
| 99 | IO: ios, |
| 100 | HttpClient: &http.Client{Transport: fakeHTTP}, |
| 101 | AttClient: api.NewTestClient(), |
| 102 | AttVerifier: shared.NewMockVerifier(result), |
| 103 | } |
| 104 | |
| 105 | err = verifyRun(cfg) |
| 106 | require.NoError(t, err) |
| 107 | } |
| 108 | |
| 109 | func Test_verifyRun_FailedNoAttestations_SHA1(t *testing.T) { |
| 110 | ios, _, _, _ := iostreams.Test() |
nothing calls this directly
no test coverage detected