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