(t *testing.T)
| 165 | } |
| 166 | |
| 167 | func TestFetchBundleFromAttestations_BundleURL(t *testing.T) { |
| 168 | httpClient := &mockHttpClient{} |
| 169 | client := LiveClient{ |
| 170 | externalHttpClient: httpClient, |
| 171 | logger: io.NewTestHandler(), |
| 172 | } |
| 173 | |
| 174 | att1 := makeTestAttestation() |
| 175 | att2 := makeTestAttestation() |
| 176 | attestations := []*Attestation{&att1, &att2} |
| 177 | fetched, err := client.fetchBundleFromAttestations(attestations) |
| 178 | require.NoError(t, err) |
| 179 | require.Len(t, fetched, 2) |
| 180 | require.NotNil(t, "application/vnd.dev.sigstore.bundle.v0.3+json", fetched[0].Bundle.GetMediaType()) |
| 181 | httpClient.AssertNumberOfCalls(t, "OnGetSuccess", 2) |
| 182 | } |
| 183 | |
| 184 | func TestFetchBundleFromAttestations_MissingBundleAndBundleURLFields(t *testing.T) { |
| 185 | httpClient := &mockHttpClient{} |
nothing calls this directly
no test coverage detected