Files
Luminary/internal/model/ingress_protocol_test.go
T
renjue b1394a2817
CI / docker (push) Successful in 3m49s
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, owner/name or short name resolution, protocol-aware admin
whitelist, and in-app API docs aligned to UI conventions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 22:36:42 +08:00

23 lines
598 B
Go

package model
import "testing"
func TestIngressKeyEffectiveProtocol(t *testing.T) {
if (IngressKey{}).EffectiveProtocol() != IngressProtocolText {
t.Fatal("empty protocol should default to text")
}
k := IngressKey{Protocol: IngressProtocolImage}
if k.EffectiveProtocol() != IngressProtocolImage {
t.Fatal("expected image protocol")
}
}
func TestIngressKeyProtocolValid(t *testing.T) {
if !IngressProtocolText.Valid() || !IngressProtocolImage.Valid() {
t.Fatal("text and image should be valid")
}
if IngressKeyProtocol("other").Valid() {
t.Fatal("unexpected valid protocol")
}
}