MCPcopy Index your code
hub / github.com/InferCore/InferCore / TestInfer_RAG_UnknownKnowledgeBase400

Function TestInfer_RAG_UnknownKnowledgeBase400

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

Source from the content-addressed store, hash-verified

262}
263
264func TestInfer_RAG_UnknownKnowledgeBase400(t *testing.T) {
265 cfg := testConfigWithFileKB(t)
266 srv := New(cfg)
267 ts := httptest.NewServer(srv.Routes())
268 defer ts.Close()
269
270 status, body := postInfer(t, ts.URL, map[string]any{
271 "request_type": "rag",
272 "tenant_id": "team-a",
273 "task_type": "simple",
274 "priority": "high",
275 "context": map[string]any{
276 "knowledge_base": "does-not-exist",
277 "query": "hello",
278 },
279 "input": map[string]any{"text": "hello"},
280 "options": map[string]any{"stream": false, "max_tokens": 128},
281 })
282 if status != http.StatusBadRequest {
283 t.Fatalf("expected 400, got %d body=%s", status, string(body))
284 }
285 assertStructuredError(t, body, errCodeRAGNotConfigured)
286}
287
288func TestInfer_RAG_EmptyQuery400(t *testing.T) {
289 cfg := testConfigWithFileKB(t)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected