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

Function TestLoad_FallbackTargetNotFound

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

Source from the content-addressed store, hash-verified

107}
108
109func TestLoad_FallbackTargetNotFound(t *testing.T) {
110 cfgPath := writeTempConfig(t, `
111backends:
112 - name: b1
113 type: mock
114 timeout_ms: 100
115 cost: { unit: 1, currency: credit }
116tenants:
117 - id: t1
118routing:
119 default_backend: b1
120reliability:
121 fallback_enabled: true
122 fallback_rules:
123 - from_backend: b1
124 on: [timeout]
125 fallback_to: missing
126`)
127
128 _, err := Load(cfgPath)
129 if err == nil || !strings.Contains(err.Error(), "fallback_to backend") {
130 t.Fatalf("expected fallback target validation error, got: %v", err)
131 }
132}
133
134func TestLoad_DuplicateRoutingRuleName(t *testing.T) {
135 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