MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / TestResolveAPIKey

Function TestResolveAPIKey

internal/providers/providers_test.go:116–128  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

114}
115
116func TestResolveAPIKey(t *testing.T) {
117 ep := providers.Endpoint{APIKeyEnv: "FOO"}
118 env := map[string]string{"FOO": "secret"}
119 got := providers.ResolveAPIKey(ep, func(k string) string { return env[k] })
120 if got != "secret" {
121 t.Fatalf("ResolveAPIKey = %q, want secret", got)
122 }
123
124 empty := providers.ResolveAPIKey(providers.Endpoint{}, func(string) string { return "x" })
125 if empty != "" {
126 t.Fatalf("ResolveAPIKey on empty APIKeyEnv = %q, want \"\"", empty)
127 }
128}
129
130func TestMaskedAPIKey(t *testing.T) {
131 tests := []struct {

Callers

nothing calls this directly

Calls 1

ResolveAPIKeyFunction · 0.92

Tested by

no test coverage detected