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