getBundle retries when the HTTP request fails
(t *testing.T)
| 305 | |
| 306 | // getBundle retries when the HTTP request fails |
| 307 | func TestGetBundle_RequestFail(t *testing.T) { |
| 308 | mockHTTPClient := &reqFailHttpClient{} |
| 309 | |
| 310 | c := &LiveClient{ |
| 311 | externalHttpClient: mockHTTPClient, |
| 312 | logger: io.NewTestHandler(), |
| 313 | } |
| 314 | |
| 315 | b, err := c.getBundle(safeurl.NewImmutableSafeURL("mybundleurl")) |
| 316 | require.Error(t, err) |
| 317 | require.Nil(t, b) |
| 318 | mockHTTPClient.AssertNumberOfCalls(t, "OnGetReqFail", 4) |
| 319 | } |
| 320 | |
| 321 | func TestGetTrustDomain(t *testing.T) { |
| 322 | fetcher := mockMetaGenerator{ |
nothing calls this directly
no test coverage detected