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

Function TestUpdateSparsePatch

internal/providers/store_test.go:162–183  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

160}
161
162func TestUpdateSparsePatch(t *testing.T) {
163 file := providers.File{Endpoints: map[string]providers.Endpoint{
164 "alpha": {Endpoint: "https://a", APIKeyEnv: "OLD", Description: "old"},
165 }}
166 patch := providers.Patch{
167 APIKeyEnv: ptr("NEW"),
168 Description: ptr("brand new"),
169 }
170 if err := providers.Update(&file, "alpha", patch); err != nil {
171 t.Fatalf("Update err = %v", err)
172 }
173 got := file.Endpoints["alpha"]
174 if got.Endpoint != "https://a" {
175 t.Fatalf("Endpoint changed unexpectedly: %q", got.Endpoint)
176 }
177 if got.APIKeyEnv != "NEW" {
178 t.Fatalf("APIKeyEnv = %q, want NEW", got.APIKeyEnv)
179 }
180 if got.Description != "brand new" {
181 t.Fatalf("Description = %q", got.Description)
182 }
183}
184
185func TestUpdateListOpsForClients(t *testing.T) {
186 file := providers.File{Endpoints: map[string]providers.Endpoint{

Callers

nothing calls this directly

Calls 2

UpdateFunction · 0.92
ptrFunction · 0.85

Tested by

no test coverage detected