(t *testing.T)
| 468 | } |
| 469 | |
| 470 | func TestInfer_PolicyRejected429(t *testing.T) { |
| 471 | srv := New(testConfig(100, true)) |
| 472 | ts := httptest.NewServer(srv.Routes()) |
| 473 | defer ts.Close() |
| 474 | |
| 475 | status, body := postInfer(t, ts.URL, map[string]any{ |
| 476 | "tenant_id": "unknown-tenant", |
| 477 | "task_type": "simple", |
| 478 | "input": map[string]any{ |
| 479 | "text": "hello", |
| 480 | }, |
| 481 | "options": map[string]any{ |
| 482 | "stream": false, |
| 483 | "max_tokens": 128, |
| 484 | }, |
| 485 | }) |
| 486 | |
| 487 | if status != http.StatusTooManyRequests { |
| 488 | t.Fatalf("expected 429, got %d", status) |
| 489 | } |
| 490 | assertStructuredError(t, body, errCodePolicyRejected) |
| 491 | } |
| 492 | |
| 493 | func TestInfer_InvalidInput400(t *testing.T) { |
| 494 | srv := New(testConfig(100, true)) |
nothing calls this directly
no test coverage detected