(t *testing.T)
| 114 | } |
| 115 | |
| 116 | func 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 | |
| 130 | func TestMaskedAPIKey(t *testing.T) { |
| 131 | tests := []struct { |
nothing calls this directly
no test coverage detected