MCPcopy Create free account
hub / github.com/InferCore/InferCore / TestLoad_DuplicateBackendName

Function TestLoad_DuplicateBackendName

internal/config/config_test.go:63–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

61}
62
63func TestLoad_DuplicateBackendName(t *testing.T) {
64 cfgPath := writeTempConfig(t, `
65backends:
66 - name: b1
67 type: mock
68 timeout_ms: 100
69 cost: { unit: 1, currency: credit }
70 - name: b1
71 type: mock
72 timeout_ms: 100
73 cost: { unit: 1, currency: credit }
74tenants:
75 - id: t1
76routing:
77 default_backend: b1
78reliability:
79 fallback_enabled: false
80`)
81
82 _, err := Load(cfgPath)
83 if err == nil || !strings.Contains(err.Error(), "duplicate backend name") {
84 t.Fatalf("expected duplicate backend validation error, got: %v", err)
85 }
86}
87
88func TestLoad_DefaultBackendNotFound(t *testing.T) {
89 cfgPath := writeTempConfig(t, `

Callers

nothing calls this directly

Calls 3

writeTempConfigFunction · 0.85
LoadFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected