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

Function TestInfer_MethodNotAllowed405

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

Source from the content-addressed store, hash-verified

539}
540
541func TestInfer_MethodNotAllowed405(t *testing.T) {
542 srv := New(testConfig(100, true))
543 ts := httptest.NewServer(srv.Routes())
544 defer ts.Close()
545
546 resp, err := http.Get(ts.URL + "/infer")
547 if err != nil {
548 t.Fatalf("do request: %v", err)
549 }
550 defer resp.Body.Close()
551
552 raw, err := io.ReadAll(resp.Body)
553 if err != nil {
554 t.Fatalf("read body: %v", err)
555 }
556
557 if resp.StatusCode != http.StatusMethodNotAllowed {
558 t.Fatalf("expected 405, got %d", resp.StatusCode)
559 }
560 assertStructuredError(t, raw, errCodeMethodNotAllowed)
561}
562
563func TestInfer_InvalidMaxTokens400(t *testing.T) {
564 srv := New(testConfig(100, true))

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected