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

Function TestInfer_InvalidInput400

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

Source from the content-addressed store, hash-verified

491}
492
493func TestInfer_InvalidInput400(t *testing.T) {
494 srv := New(testConfig(100, true))
495 ts := httptest.NewServer(srv.Routes())
496 defer ts.Close()
497
498 status, body := postInfer(t, ts.URL, map[string]any{
499 "tenant_id": "team-a",
500 "task_type": "simple",
501 "options": map[string]any{
502 "stream": false,
503 "max_tokens": 128,
504 },
505 })
506
507 if status != http.StatusBadRequest {
508 t.Fatalf("expected 400, got %d", status)
509 }
510 assertStructuredError(t, body, errCodeInvalidRequest)
511}
512
513func TestInfer_InvalidJSON400(t *testing.T) {
514 srv := New(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