(t *testing.T)
| 322 | } |
| 323 | |
| 324 | func TestGetTrustDomain(t *testing.T) { |
| 325 | fetcher := mockMetaGenerator{ |
| 326 | TrustDomain: "foo", |
| 327 | } |
| 328 | |
| 329 | t.Run("with returned trust domain", func(t *testing.T) { |
| 330 | c := LiveClient{ |
| 331 | githubAPI: mockAPIClient{ |
| 332 | OnREST: fetcher.OnREST, |
| 333 | }, |
| 334 | logger: io.NewTestHandler(), |
| 335 | } |
| 336 | td, err := c.GetTrustDomain() |
| 337 | require.Nil(t, err) |
| 338 | require.Equal(t, "foo", td) |
| 339 | |
| 340 | }) |
| 341 | |
| 342 | t.Run("with error", func(t *testing.T) { |
| 343 | c := LiveClient{ |
| 344 | githubAPI: mockAPIClient{ |
| 345 | OnREST: fetcher.OnRESTError, |
| 346 | }, |
| 347 | logger: io.NewTestHandler(), |
| 348 | } |
| 349 | td, err := c.GetTrustDomain() |
| 350 | require.Equal(t, "", td) |
| 351 | require.ErrorContains(t, err, "test error") |
| 352 | }) |
| 353 | |
| 354 | } |
| 355 | |
| 356 | func TestGetAttestationsRetries(t *testing.T) { |
| 357 | getAttestationRetryInterval = 0 |
nothing calls this directly
no test coverage detected