MCPcopy
hub / github.com/cli/cli / TestFetchBundleFromAttestations_BundleURL

Function TestFetchBundleFromAttestations_BundleURL

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

Source from the content-addressed store, hash-verified

165}
166
167func 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
184func TestFetchBundleFromAttestations_MissingBundleAndBundleURLFields(t *testing.T) {
185 httpClient := &mockHttpClient{}

Callers

nothing calls this directly

Calls 4

NewTestHandlerFunction · 0.92
makeTestAttestationFunction · 0.70
LenMethod · 0.65

Tested by

no test coverage detected