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

Function TestResolveSources_URLEncodedKey

pkg/config/resolve_test.go:791–807  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

789}
790
791func TestResolveSources_URLEncodedKey(t *testing.T) {
792 t.Parallel()
793
794 testURL := "https://example.com/agent.yaml?agentTag=v1.0.0-dev&origin=cli"
795
796 sources, err := ResolveSources(testURL, nil)
797 require.NoError(t, err)
798 require.Len(t, sources, 1)
799
800 // The key should be the URL-encoded version of the URL
801 expectedKey := url.QueryEscape(testURL)
802 source, ok := sources[expectedKey]
803 require.True(t, ok, "expected source key '%s'", expectedKey)
804
805 // The source Name() should still return the original URL for fetching
806 assert.Equal(t, testURL, source.Name())
807}
808
809func TestStableSourceKey(t *testing.T) {
810 t.Parallel()

Callers

nothing calls this directly

Calls 3

ResolveSourcesFunction · 0.85
LenMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected