Download cmd/server/upstream_port_config_test.go from a3216/gcli2api: direct link, hf CLI and curl.
- Browser
- Download file 488 Bytes
-
https://huggingface.co/spaces/a3216/gcli2api/resolve/main/cmd/server/upstream_port_config_test.go
- Command line
-
hf download hf://spaces/a3216/gcli2api/cmd/server/upstream_port_config_test.go
-
curl -L -o upstream_port_config_test.go https://huggingface.co/spaces/a3216/gcli2api/resolve/main/cmd/server/upstream_port_config_test.go
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") | |
| } | |
| } | |