Files
Luminary/internal/prediction/models_test.go
T
renjue 4b0b5356c2
CI / docker (push) Successful in 2m55s
Split ingress keys into text/image protocols with Replicate model listing.
Text keys use OpenAI routes; image keys use predictions with ingress Model ID,
OpenAPI input schemas, protocol-aware admin whitelist, and in-app API docs aligned to UI conventions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 21:54:28 +08:00

28 lines
728 B
Go

package prediction
import (
"testing"
"github.com/rose_cat707/luminary/internal/model"
)
func TestSplitOwnerName(t *testing.T) {
owner, name := splitOwnerName("luminary/flux-sdxl", "comfy-local")
if owner != "luminary" || name != "flux-sdxl" {
t.Fatalf("got %q/%q", owner, name)
}
owner, name = splitOwnerName("plain-model", "")
if owner != "luminary" || name != "plain-model" {
t.Fatalf("got %q/%q", owner, name)
}
}
func TestModelDescription(t *testing.T) {
if modelDescription(model.ModelEntry{WorkflowType: model.WorkflowImg2Img}) == "" {
t.Fatal("expected default img2img description")
}
if got := modelDescription(model.ModelEntry{DisplayName: "FLUX"}); got != "FLUX" {
t.Fatalf("got %q", got)
}
}