MCPcopy
hub / github.com/docker/docker-agent / TestResolve_URLReference_WithEnvProvider

Function TestResolve_URLReference_WithEnvProvider

pkg/config/sources_test.go:1059–1074  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1057}
1058
1059func TestResolve_URLReference_WithEnvProvider(t *testing.T) {
1060 t.Parallel()
1061
1062 envProvider := environment.NewMapEnvProvider(map[string]string{
1063 "GITHUB_TOKEN": "test-token",
1064 })
1065
1066 source, err := Resolve("https://github.com/owner/repo/raw/main/agent.yaml", envProvider)
1067 require.NoError(t, err)
1068 assert.Equal(t, "https://github.com/owner/repo/raw/main/agent.yaml", source.Name())
1069
1070 // Verify the source has the env provider set
1071 urlSrc, ok := source.(*urlSource)
1072 require.True(t, ok)
1073 assert.NotNil(t, urlSrc.envProvider)
1074}
1075
1076func TestResolveSources_URLReference_WithEnvProvider(t *testing.T) {
1077 t.Parallel()

Callers

nothing calls this directly

Calls 3

NewMapEnvProviderFunction · 0.92
ResolveFunction · 0.70
NameMethod · 0.65

Tested by

no test coverage detected