(t *testing.T)
| 273 | } |
| 274 | |
| 275 | func TestNeedsRetryNoRetryWhenInvalidScope(t *testing.T) { |
| 276 | resp := registrySuseComResp |
| 277 | resp.Header["Www-Authenticate"] = []string{ |
| 278 | `Bearer realm="https://registry.suse.com/auth",service="SUSE Linux Docker Registry",scope="foo:bar",error="insufficient_scope"`, |
| 279 | } |
| 280 | |
| 281 | needsRetry, _ := needsRetryWithUpdatedScope(&resp) |
| 282 | |
| 283 | if needsRetry { |
| 284 | t.Fatal("Expected no need to retry, as no insufficient_error is present in the authentication header") |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | func TestNeedsNoRetry(t *testing.T) { |
| 289 | resp := http.Response{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…