(t *testing.T)
| 539 | } |
| 540 | |
| 541 | func 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 | |
| 563 | func TestInfer_InvalidMaxTokens400(t *testing.T) { |
| 564 | srv := New(testConfig(100, true)) |
nothing calls this directly
no test coverage detected