MCPcopy Index your code
hub / github.com/InferCore/InferCore / TestLoad_FallbackRuleRequiresTrigger

Function TestLoad_FallbackRuleRequiresTrigger

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

Source from the content-addressed store, hash-verified

158}
159
160func TestLoad_FallbackRuleRequiresTrigger(t *testing.T) {
161 cfgPath := writeTempConfig(t, `
162backends:
163 - name: b1
164 type: mock
165 timeout_ms: 100
166 cost: { unit: 1, currency: credit }
167tenants:
168 - id: t1
169routing:
170 default_backend: b1
171reliability:
172 fallback_enabled: true
173 fallback_rules:
174 - from_backend: b1
175 fallback_to: b1
176 on: []
177`)
178
179 _, err := Load(cfgPath)
180 if err == nil || !strings.Contains(err.Error(), "must define at least one trigger") {
181 t.Fatalf("expected fallback trigger validation error, got: %v", err)
182 }
183}
184
185func TestLoad_FallbackRuleInvalidTrigger(t *testing.T) {
186 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