(lim *admission.Limiter, store *recordingStore, cfg *config.ModelConfig, handler echo.HandlerFunc)
| 37 | func (r *recordingStore) Close() error { return nil } |
| 38 | |
| 39 | func runAdmission(lim *admission.Limiter, store *recordingStore, cfg *config.ModelConfig, handler echo.HandlerFunc) (*httptest.ResponseRecorder, error) { |
| 40 | req := httptest.NewRequest(http.MethodPost, "/v1/chat/completions", strings.NewReader("{}")) |
| 41 | rec := httptest.NewRecorder() |
| 42 | c := echo.New().NewContext(req, rec) |
| 43 | c.Set(CONTEXT_LOCALS_KEY_MODEL_CONFIG, cfg) |
| 44 | mw := AdmissionControl(lim, store) |
| 45 | err := mw(handler)(c) |
| 46 | return rec, err |
| 47 | } |
| 48 | |
| 49 | var _ = Describe("Admission", func() { |
| 50 | It("allows when under limit", func() { |
no test coverage detected