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

Function TestLoad_DuplicateRoutingRuleName

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

Source from the content-addressed store, hash-verified

132}
133
134func TestLoad_DuplicateRoutingRuleName(t *testing.T) {
135 cfgPath := writeTempConfig(t, `
136backends:
137 - name: b1
138 type: mock
139 timeout_ms: 100
140 cost: { unit: 1, currency: credit }
141tenants:
142 - id: t1
143routing:
144 default_backend: b1
145 rules:
146 - name: same-rule
147 use_backend: b1
148 - name: same-rule
149 use_backend: b1
150reliability:
151 fallback_enabled: false
152`)
153
154 _, err := Load(cfgPath)
155 if err == nil || !strings.Contains(err.Error(), "duplicate routing rule name") {
156 t.Fatalf("expected duplicate routing rule name validation error, got: %v", err)
157 }
158}
159
160func TestLoad_FallbackRuleRequiresTrigger(t *testing.T) {
161 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