From ffef451f7a6eed2d60f8becb869977b090daba88 Mon Sep 17 00:00:00 2001 From: dinhnn Date: Thu, 7 May 2026 13:48:03 +0700 Subject: [PATCH] Fixbug test typing --- internal/httpapi/ollama/handler_routes_test.go | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/internal/httpapi/ollama/handler_routes_test.go b/internal/httpapi/ollama/handler_routes_test.go index eafed87..54cee70 100644 --- a/internal/httpapi/ollama/handler_routes_test.go +++ b/internal/httpapi/ollama/handler_routes_test.go @@ -4,29 +4,19 @@ import ( "net/http" "net/http/httptest" "testing" - + "strings" "github.com/go-chi/chi/v5" ) type ollamaTestSurface struct { - Store shared.ConfigReader + Store ConfigReader handler *Handler } -GetVersion(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - _, _ = w.Write([]byte(`{"version":"0.23.1"}`)) -} -func (h *Handler) ListOllamaModels(w http.ResponseWriter, r *http.Request) { - WriteJSON(w, http.StatusOK, config.OllamaModelsResponse()) -} -func (h *Handler) GetOllamaModel - func registerOllamaTestRoutes(r chi.Router, h *ollamaTestSurface) { r.Get("/api/version", h.handler().GetVersion) - r.Get("/api/tags", h.modelsHandler().ListOllamaModels) - r.Post("/api/show", h.chatHandler().GetOllamaModel) + r.Get("/api/tags", h.handler().ListOllamaModels) + r.Post("/api/show", h.handler().GetOllamaModel) }