P0 fixes: - ModelError.Is(): use exact matching instead of substring contains() - shouldClearStickySession: add context param for cancellation/tracing P1 fixes: - TODO stubs: return 501 Not Implemented errors - validateInstanceSignature: deduplicate to shared validateCodeSignature() - Error messages: standardize to English only - http.go: remove pseudo if-else with duplicate branches
29 lines
616 B
Go
29 lines
616 B
Go
package gemini
|
|
|
|
import "testing"
|
|
|
|
func TestDefaultModels_ContainsImageModels(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
models := DefaultModels()
|
|
byName := make(map[string]Model, len(models))
|
|
for _, model := range models {
|
|
byName[model.Name] = model
|
|
}
|
|
|
|
required := []string{
|
|
"models/gemini-2.5-flash-image",
|
|
"models/gemini-3.1-flash-image",
|
|
}
|
|
|
|
for _, name := range required {
|
|
model, ok := byName[name]
|
|
if !ok {
|
|
t.Fatalf("expected fallback model %q to exist", name)
|
|
}
|
|
if len(model.SupportedGenerationMethods) == 0 {
|
|
t.Fatalf("expected fallback model %q to advertise generation methods", name)
|
|
}
|
|
}
|
|
}
|