MCPcopy Index your code
hub / github.com/cli/cli / TestGetByDigest

Function TestGetByDigest

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

Source from the content-addressed store, hash-verified

110}
111
112func TestGetByDigest(t *testing.T) {
113 for _, tc := range getByTestCases {
114 t.Run(tc.name, func(t *testing.T) {
115 c := NewClientWithMockGHClient(tc.hasNextPage)
116
117 if tc.limit > 0 {
118 tc.params.Limit = tc.limit
119 }
120 attestations, err := c.GetByDigest(tc.params)
121 require.NoError(t, err)
122
123 require.Equal(t, tc.expectedAttestations, len(attestations))
124 bundle := (attestations)[0].Bundle
125 require.Equal(t, bundle.GetMediaType(), "application/vnd.dev.sigstore.bundle.v0.3+json")
126 })
127 }
128}
129
130func TestGetByDigest_NoAttestationsFound(t *testing.T) {
131 fetcher := mockDataGenerator{

Callers

nothing calls this directly

Calls 4

EqualMethod · 0.80
RunMethod · 0.65
GetByDigestMethod · 0.65

Tested by

no test coverage detected