(t *testing.T)
| 286 | } |
| 287 | |
| 288 | func TestNeedsNoRetry(t *testing.T) { |
| 289 | resp := http.Response{ |
| 290 | Status: "200 OK", |
| 291 | StatusCode: http.StatusOK, |
| 292 | Proto: "HTTP/1.1", |
| 293 | ProtoMajor: 1, |
| 294 | ProtoMinor: 1, |
| 295 | Header: map[string][]string{"Apptime": {"D=49722"}, |
| 296 | "Content-Length": {"1683"}, |
| 297 | "Content-Type": {"application/json; charset=utf-8"}, |
| 298 | "Date": {"Fri, 26 Aug 2022 09:00:21 GMT"}, |
| 299 | "Docker-Distribution-Api-Version": {"registry/2.0"}, |
| 300 | "Link": {`</v2/_catalog?last=f35%2Fs2i-base&n=100>; rel="next"`}, |
| 301 | "Referrer-Policy": {"same-origin"}, |
| 302 | "Server": {"Apache"}, |
| 303 | "Strict-Transport-Security": {"max-age=31536000; includeSubDomains; preload"}, |
| 304 | "Vary": {"Accept"}, |
| 305 | "X-Content-Type-Options": {"nosniff"}, |
| 306 | "X-Fedora-Proxyserver": {"proxy10.iad2.fedoraproject.org"}, |
| 307 | "X-Fedora-Requestid": {"YwiLpHEhLsbSTugJblBF8QAAAEI"}, |
| 308 | "X-Frame-Options": {"SAMEORIGIN"}, |
| 309 | "X-Xss-Protection": {"1; mode=block"}, |
| 310 | }, |
| 311 | } |
| 312 | |
| 313 | needsRetry, _ := needsRetryWithUpdatedScope(&resp) |
| 314 | if needsRetry { |
| 315 | t.Fatal("Got the need to retry, but none should be required") |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | func TestParseRegistryWarningHeader(t *testing.T) { |
| 320 | for _, c := range []struct{ header, expected string }{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…