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

Function TestRuleRouter_ContextCanceled

internal/router/rule_router_test.go:194–205  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

192}
193
194func TestRuleRouter_ContextCanceled(t *testing.T) {
195 r := NewRuleRouter(testRouterConfig(), nil)
196 ctx, cancel := context.WithCancel(context.Background())
197 cancel()
198 _, err := r.SelectRoute(ctx, types.AIRequest{
199 TenantID: "team-a",
200 TaskType: "simple",
201 }, types.RuntimeState{})
202 if err == nil {
203 t.Fatal("expected error from canceled context")
204 }
205}

Callers

nothing calls this directly

Calls 3

SelectRouteMethod · 0.95
NewRuleRouterFunction · 0.85
testRouterConfigFunction · 0.85

Tested by

no test coverage detected