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

Function TestAddHappyAndDuplicate

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

Source from the content-addressed store, hash-verified

136}
137
138func TestAddHappyAndDuplicate(t *testing.T) {
139 file := providers.File{Endpoints: map[string]providers.Endpoint{}}
140 if err := providers.Add(&file, "alpha", providers.Endpoint{Endpoint: "https://a"}); err != nil {
141 t.Fatalf("Add err = %v", err)
142 }
143 if file.Endpoints["alpha"].Endpoint != "https://a" {
144 t.Fatal("expected alpha endpoint stored")
145 }
146 err := providers.Add(&file, "alpha", providers.Endpoint{})
147 if !errors.Is(err, providers.ErrAlreadyExists) {
148 t.Fatalf("Add duplicate err = %v, want ErrAlreadyExists", err)
149 }
150}
151
152func TestAddRejectsInvalidName(t *testing.T) {
153 file := providers.File{Endpoints: map[string]providers.Endpoint{}}

Callers

nothing calls this directly

Calls 1

AddFunction · 0.92

Tested by

no test coverage detected