(t *testing.T)
| 110 | } |
| 111 | |
| 112 | func 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 | |
| 130 | func TestGetByDigest_NoAttestationsFound(t *testing.T) { |
| 131 | fetcher := mockDataGenerator{ |
nothing calls this directly
no test coverage detected