feat: full model catalog (settings enabledModels + custom providers) and provider credentials in spawned containers (keys passthrough + host auth.json bind)
This commit is contained in:
@@ -562,3 +562,16 @@ func TestAPIRepoImagesStoreFailure(t *testing.T) {
|
||||
t.Fatal("DELETE with broken store must 500")
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseEnabledModels(t *testing.T) {
|
||||
items := parseEnabledModels([]byte(`{"enabledModels":["anthropic/claude-opus-5","zai/glm","bad","/x","p/"]}`))
|
||||
if len(items) != 2 {
|
||||
t.Fatalf("items = %+v, want 2 valid", items)
|
||||
}
|
||||
if items[0].Provider != "anthropic" || items[0].ID != "claude-opus-5" {
|
||||
t.Fatalf("first = %+v", items[0])
|
||||
}
|
||||
if parseEnabledModels([]byte("not json")) != nil {
|
||||
t.Fatal("invalid json must yield nil")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user