(t *testing.T)
| 401 | } |
| 402 | |
| 403 | func TestHTTPFallbackResolver(t *testing.T) { |
| 404 | sf := func(h http.Handler) (string, ResolverOptions, func()) { |
| 405 | s := httptest.NewServer(h) |
| 406 | u, err := url.Parse(s.URL) |
| 407 | if err != nil { |
| 408 | t.Fatal(err) |
| 409 | } |
| 410 | |
| 411 | client := &http.Client{ |
| 412 | Transport: NewHTTPFallback(http.DefaultTransport), |
| 413 | } |
| 414 | options := ResolverOptions{ |
| 415 | Hosts: func(host string) ([]RegistryHost, error) { |
| 416 | return []RegistryHost{ |
| 417 | { |
| 418 | Client: client, |
| 419 | Host: u.Host, |
| 420 | Scheme: "https", |
| 421 | Path: "/v2", |
| 422 | Capabilities: HostCapabilityPull | HostCapabilityResolve | HostCapabilityPush, |
| 423 | }, |
| 424 | }, nil |
| 425 | }, |
| 426 | } |
| 427 | return u.Host, options, s.Close |
| 428 | } |
| 429 | |
| 430 | runBasicTest(t, "testname", sf) |
| 431 | } |
| 432 | |
| 433 | func TestHTTPFallbackTimeoutResolver(t *testing.T) { |
| 434 | sf := func(h http.Handler) (string, ResolverOptions, func()) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…