(t *testing.T)
| 43 | } |
| 44 | |
| 45 | func TestRuleRouter_UsesRuleMatch(t *testing.T) { |
| 46 | r := NewRuleRouter(testRouterConfig(), nil) |
| 47 | decision, err := r.SelectRoute(context.Background(), types.AIRequest{ |
| 48 | TenantID: "team-a", |
| 49 | TaskType: "simple", |
| 50 | }, types.RuntimeState{}) |
| 51 | if err != nil { |
| 52 | t.Fatalf("unexpected error: %v", err) |
| 53 | } |
| 54 | if decision.BackendName != "large-model" { |
| 55 | t.Fatalf("expected large-model, got %s", decision.BackendName) |
| 56 | } |
| 57 | if decision.Reason != "premium-simple-expensive-route" { |
| 58 | t.Fatalf("unexpected reason: %s", decision.Reason) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | func TestRuleRouter_FallsBackToDefault(t *testing.T) { |
| 63 | r := NewRuleRouter(testRouterConfig(), nil) |
nothing calls this directly
no test coverage detected