gcli2api / cmd /server /upstream_port_config_test.go
a3216's picture
feat: 同步上游 320f5d4;扩展模型(多免费渠道/自定义映射/访问密钥/模型白名单)
e48a2d8
Raw History Blame Contribute Delete
488 Bytes
package main
import "testing"
func TestBudgetAndJitterRejectBadValues(t *testing.T) {
c := Default()
c.Budget.DailyCreditLimit = -1
if err := c.normalize(); err == nil {
t.Fatal("negative budget should fail")
}
c = Default()
c.Schedule.JitterMinutes = 1441
if err := c.normalize(); err == nil {
t.Fatal("jitter over a day should fail")
}
c = Default()
c.Alerting.Enabled = true
if err := c.normalize(); err == nil {
t.Fatal("alerting without webhook should fail")
}
}