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

Function TestInfer_InvalidMaxTokens400

internal/server/server_test.go:563–584  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

561}
562
563func TestInfer_InvalidMaxTokens400(t *testing.T) {
564 srv := New(testConfig(100, true))
565 ts := httptest.NewServer(srv.Routes())
566 defer ts.Close()
567
568 status, body := postInfer(t, ts.URL, map[string]any{
569 "tenant_id": "team-a",
570 "task_type": "simple",
571 "input": map[string]any{
572 "text": "hello",
573 },
574 "options": map[string]any{
575 "stream": false,
576 "max_tokens": 0,
577 },
578 })
579
580 if status != http.StatusBadRequest {
581 t.Fatalf("expected 400, got %d", status)
582 }
583 assertStructuredError(t, body, errCodeInvalidOptions)
584}
585
586func TestHTTPLayerTimeouts_Overrides(t *testing.T) {
587 cfg := testConfig(100, true)

Callers

nothing calls this directly

Calls 6

postInferFunction · 0.85
assertStructuredErrorFunction · 0.85
RoutesMethod · 0.80
NewFunction · 0.70
testConfigFunction · 0.70
CloseMethod · 0.65

Tested by

no test coverage detected