diff options
Diffstat (limited to 'internal/llm/openrouter_test.go')
| -rw-r--r-- | internal/llm/openrouter_test.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/llm/openrouter_test.go b/internal/llm/openrouter_test.go index f8efe16..07d6e0f 100644 --- a/internal/llm/openrouter_test.go +++ b/internal/llm/openrouter_test.go @@ -8,6 +8,7 @@ import ( "net/http" "net/http/httptest" "os" + "strings" "testing" "codeberg.org/snonux/hexai/internal/logging" @@ -102,6 +103,8 @@ func TestOpenRouter_Chat_MissingKey(t *testing.T) { c := newOpenRouter("http://example", "anthropic/claude-test", "", f64p(0.2)).(openRouterClient) if _, err := c.Chat(context.Background(), []Message{{Role: "user", Content: "ping"}}); err == nil { t.Fatalf("expected error for missing api key") + } else if !strings.Contains(err.Error(), "OPENROUTER_API_KEY") || !strings.Contains(err.Error(), "HEXAI_OPENROUTER_API_KEY") { + t.Fatalf("expected actionable API key hint, got %q", err.Error()) } } |
