getBundle successfully fetches a bundle on the first HTTP request attempt
(t *testing.T)
| 254 | |
| 255 | // getBundle successfully fetches a bundle on the first HTTP request attempt |
| 256 | func TestGetBundle(t *testing.T) { |
| 257 | mockHTTPClient := &mockHttpClient{} |
| 258 | |
| 259 | c := &LiveClient{ |
| 260 | externalHttpClient: mockHTTPClient, |
| 261 | logger: io.NewTestHandler(), |
| 262 | } |
| 263 | |
| 264 | b, err := c.getBundle("https://mybundleurl.com") |
| 265 | require.NoError(t, err) |
| 266 | require.Equal(t, "application/vnd.dev.sigstore.bundle.v0.3+json", b.GetMediaType()) |
| 267 | mockHTTPClient.AssertNumberOfCalls(t, "OnGetSuccess", 1) |
| 268 | } |
| 269 | |
| 270 | // getBundle retries successfully when the initial HTTP request returns |
| 271 | // a 5XX status code |
nothing calls this directly
no test coverage detected
searching dependent graphs…