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

Function TestMaskedAPIKey

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

Source from the content-addressed store, hash-verified

128}
129
130func TestMaskedAPIKey(t *testing.T) {
131 tests := []struct {
132 in, want string
133 }{
134 {"", ""},
135 {"short", "*****"},
136 {"abcdefgh", "********"},
137 {"abcdefghij", "abcd**ghij"},
138 {"sk-1234567890abcdef", "sk-1***********cdef"},
139 }
140 for _, tc := range tests {
141 tc := tc
142 t.Run(tc.in, func(t *testing.T) {
143 t.Parallel()
144 if got := providers.MaskedAPIKey(tc.in); got != tc.want {
145 t.Fatalf("MaskedAPIKey(%q) = %q, want %q", tc.in, got, tc.want)
146 }
147 })
148 }
149}
150
151func loadLegacyFileForTest(path string) (providers.File, error) {
152 data, err := os.ReadFile(path)

Callers

nothing calls this directly

Calls 2

MaskedAPIKeyFunction · 0.92
RunMethod · 0.65

Tested by

no test coverage detected