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

Function TestFetchBundleFromAttestations_BundleURL

pkg/cmd/attestation/api/client_test.go:168–183  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

NewTestHandlerFunction · 0.92
makeTestAttestationFunction · 0.70
LenMethod · 0.65

Tested by

no test coverage detected