MCPcopy Create free account
hub / github.com/docker/docker-agent / TestResolveSource_NoMatchFails

Function TestResolveSource_NoMatchFails

pkg/server/resolve_source_test.go:76–88  ·  view source on GitHub ↗

TestResolveSource_NoMatchFails verifies the plain not-found path is preserved for references that share no stable identity with any live source.

(t *testing.T)

Source from the content-addressed store, hash-verified

74// TestResolveSource_NoMatchFails verifies the plain not-found path is preserved
75// for references that share no stable identity with any live source.
76func TestResolveSource_NoMatchFails(t *testing.T) {
77 t.Parallel()
78
79 sm := &SessionManager{
80 Sources: config.Sources{
81 gordonKey("v9-dev"): config.NewBytesSource("dev", []byte("dev")),
82 },
83 }
84
85 _, err := sm.resolveSource(url.QueryEscape("http://localhost:7777/other-agent?gordonTag=v9-dev"))
86 require.Error(t, err)
87 assert.Contains(t, err.Error(), "agent not found")
88}
89
90// TestResolveSource_LocalFileKeyExactOnly verifies that non-URL keys (local
91// files, OCI refs) still resolve only by exact match, since their stable

Callers

nothing calls this directly

Calls 4

resolveSourceMethod · 0.95
NewBytesSourceFunction · 0.92
gordonKeyFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected