Add projects
This commit is contained in:
parent
2d3a9ad623
commit
8b607dd700
1802 changed files with 503346 additions and 2 deletions
54
backend/internal/config/cooling_override_test.go
Normal file
54
backend/internal/config/cooling_override_test.go
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
package config
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestParseConfigBytesPreservesCoolingOverridePresence(t *testing.T) {
|
||||
cfg, errParse := ParseConfigBytes([]byte(`
|
||||
disable-cooling: true
|
||||
gemini-api-key:
|
||||
- api-key: gemini-key
|
||||
disable-cooling: false
|
||||
interactions-api-key:
|
||||
- api-key: interactions-key
|
||||
disable-cooling: false
|
||||
claude-api-key:
|
||||
- api-key: claude-key
|
||||
disable-cooling: false
|
||||
codex-api-key:
|
||||
- api-key: codex-key
|
||||
base-url: https://codex.example.com
|
||||
disable-cooling: false
|
||||
xai-api-key:
|
||||
- api-key: xai-key
|
||||
base-url: https://api.x.ai/v1
|
||||
disable-cooling: false
|
||||
openai-compatibility:
|
||||
- name: compat
|
||||
base-url: https://compat.example.com
|
||||
disable-cooling: false
|
||||
api-key-entries:
|
||||
- api-key: compat-key
|
||||
vertex-api-key:
|
||||
- api-key: vertex-key
|
||||
base-url: https://vertex.example.com
|
||||
disable-cooling: false
|
||||
`))
|
||||
if errParse != nil {
|
||||
t.Fatalf("ParseConfigBytes() error = %v", errParse)
|
||||
}
|
||||
|
||||
overrides := map[string]*bool{
|
||||
"gemini": cfg.GeminiKey[0].DisableCooling,
|
||||
"interactions": cfg.InteractionsKey[0].DisableCooling,
|
||||
"claude": cfg.ClaudeKey[0].DisableCooling,
|
||||
"codex": cfg.CodexKey[0].DisableCooling,
|
||||
"xai": cfg.XAIKey[0].DisableCooling,
|
||||
"openai compatibility": cfg.OpenAICompatibility[0].DisableCooling,
|
||||
"vertex": cfg.VertexCompatAPIKey[0].DisableCooling,
|
||||
}
|
||||
for name, override := range overrides {
|
||||
if override == nil || *override {
|
||||
t.Errorf("%s disable-cooling = %v, want explicit false", name, override)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue