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