feat(ai): test saved summary model generation (#43)

This commit is contained in:
2026-11-25 09:32:05 +01:00
parent 33dcc11aa5
commit a3738de516
27 changed files with 1595 additions and 43 deletions

View File

@ -0,0 +1,28 @@
package api_test
import (
"github.com/tradarr/backend/internal/api"
"github.com/tradarr/backend/internal/api/handlers"
"github.com/tradarr/backend/internal/config"
"net/http"
"net/http/httptest"
"testing"
)
func TestTicket43ModelGenerationTestRouteRequiresAuthentication(t *testing.T) {
router := api.SetupRouter(handlers.New(nil, &config.Config{}, nil, nil, nil, nil), "fixture43")
found := false
for _, route := range router.Routes() {
if route.Method == http.MethodPost && route.Path == "/api/admin/ai-models/:id/test" {
found = true
}
}
if !found {
t.Fatal("model generation test route missing")
}
w := httptest.NewRecorder()
router.ServeHTTP(w, httptest.NewRequest(http.MethodPost, "/api/admin/ai-models/00000000-0000-0000-0000-000000004301/test", nil))
if w.Code != 401 {
t.Fatal("model generation test is not authenticated")
}
}