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