summaryrefslogtreecommitdiff
path: root/internal/config/config_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/config_test.go')
-rw-r--r--internal/config/config_test.go27
1 files changed, 22 insertions, 5 deletions
diff --git a/internal/config/config_test.go b/internal/config/config_test.go
index f71b9cc..4167ff7 100644
--- a/internal/config/config_test.go
+++ b/internal/config/config_test.go
@@ -71,11 +71,14 @@ func TestRunnersConfig_DefaultsAllEnabled(t *testing.T) {
if !r.AnthropicEnabled() {
t.Error("anthropic should be enabled by default (nil)")
}
+ if !r.GoogleEnabled() {
+ t.Error("google should be enabled by default (nil)")
+ }
}
func TestRunnersConfig_ExplicitFalseDisables(t *testing.T) {
f := false
- r := RunnersConfig{Claude: &f, Gemini: &f, Local: &f, Container: &f, Anthropic: &f}
+ r := RunnersConfig{Claude: &f, Gemini: &f, Local: &f, Container: &f, Anthropic: &f, Google: &f}
if r.ClaudeEnabled() {
t.Error("explicit false should disable claude")
}
@@ -91,12 +94,15 @@ func TestRunnersConfig_ExplicitFalseDisables(t *testing.T) {
if r.AnthropicEnabled() {
t.Error("explicit false should disable anthropic")
}
+ if r.GoogleEnabled() {
+ t.Error("explicit false should disable google")
+ }
}
func TestRunnersConfig_ExplicitTrueEnables(t *testing.T) {
tr := true
- r := RunnersConfig{Claude: &tr, Gemini: &tr, Local: &tr, Container: &tr, Anthropic: &tr}
- if !r.ClaudeEnabled() || !r.GeminiEnabled() || !r.LocalEnabled() || !r.ContainerEnabled() || !r.AnthropicEnabled() {
+ r := RunnersConfig{Claude: &tr, Gemini: &tr, Local: &tr, Container: &tr, Anthropic: &tr, Google: &tr}
+ if !r.ClaudeEnabled() || !r.GeminiEnabled() || !r.LocalEnabled() || !r.ContainerEnabled() || !r.AnthropicEnabled() || !r.GoogleEnabled() {
t.Error("explicit true should keep all runners enabled")
}
}
@@ -185,6 +191,10 @@ timeout_seconds = 30
[providers.anthropic]
api_key = "sk-ant-xyz"
default_model = "claude-sonnet-4-5"
+
+[providers.google]
+api_key = "AIza-abc"
+default_model = "gemini-2.5-flash"
`
if err := os.WriteFile(path, []byte(toml), 0600); err != nil {
t.Fatal(err)
@@ -195,8 +205,8 @@ default_model = "claude-sonnet-4-5"
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
- if len(cfg.Providers) != 2 {
- t.Fatalf("expected 2 providers, got %d: %+v", len(cfg.Providers), cfg.Providers)
+ if len(cfg.Providers) != 3 {
+ t.Fatalf("expected 3 providers, got %d: %+v", len(cfg.Providers), cfg.Providers)
}
groq, ok := cfg.Providers["groq"]
if !ok {
@@ -213,4 +223,11 @@ default_model = "claude-sonnet-4-5"
if anthropic.Endpoint != "" || anthropic.APIKey != "sk-ant-xyz" || anthropic.DefaultModel != "claude-sonnet-4-5" {
t.Errorf("anthropic provider config: %+v", anthropic)
}
+ google, ok := cfg.Providers["google"]
+ if !ok {
+ t.Fatal("expected [providers.google] table")
+ }
+ if google.Endpoint != "" || google.APIKey != "AIza-abc" || google.DefaultModel != "gemini-2.5-flash" {
+ t.Errorf("google provider config: %+v", google)
+ }
}