MCPcopy Create free account
hub / github.com/containers/image / TestNeedsRetryNoRetryWhenInvalidScope

Function TestNeedsRetryNoRetryWhenInvalidScope

docker/docker_client_test.go:275–286  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

273}
274
275func 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
288func TestNeedsNoRetry(t *testing.T) {
289 resp := http.Response{

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…