MCPcopy Index your code
hub / github.com/docker/docker-agent / TestPullRegistryNotFound

Function TestPullRegistryNotFound

pkg/remote/pull_test.go:410–432  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

408}
409
410func TestPullRegistryNotFound(t *testing.T) {
411 t.Parallel()
412
413 // Use a test server that returns 404 for fast failure
414 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
415 w.WriteHeader(http.StatusNotFound)
416 }))
417 defer server.Close()
418
419 // Extract host:port from server URL (remove http://)
420 registry := strings.TrimPrefix(server.URL, "http://")
421
422 // Test various image references that should fail with 404
423 refs := []string{
424 registry + "/non-existent:latest",
425 registry + "/test:latest",
426 }
427
428 for _, ref := range refs {
429 _, err := Pull(t.Context(), ref, false, crane.Insecure)
430 require.Error(t, err, "expected error for ref: %s", ref)
431 }
432}
433
434func TestPullIntegration(t *testing.T) {
435 t.Parallel()

Callers

nothing calls this directly

Calls 4

PullFunction · 0.85
ContextMethod · 0.80
CloseMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected