Fix web config and search tool tests

This commit is contained in:
PhotoPortfolio Developer 2026-02-19 22:17:01 +08:00
parent 3be030b149
commit c3967a560d
2 changed files with 7 additions and 7 deletions

View file

@ -289,14 +289,14 @@ func TestDefaultConfig_WebTools(t *testing.T) {
cfg := DefaultConfig()
// Verify web tools defaults
if cfg.Tools.Web.Brave.MaxResults != 5 {
t.Error("Expected Brave MaxResults 5, got ", cfg.Tools.Web.Brave.MaxResults)
if cfg.Tools.Web.Search.MaxResults != 5 {
t.Error("Expected Search MaxResults 5, got ", cfg.Tools.Web.Search.MaxResults)
}
if cfg.Tools.Web.Brave.APIKey != "" {
t.Error("Brave API key should be empty by default")
if cfg.Tools.Web.Search.Provider == "" {
t.Error("Search provider should not be empty by default")
}
if cfg.Tools.Web.DuckDuckGo.MaxResults != 5 {
t.Error("Expected DuckDuckGo MaxResults 5, got ", cfg.Tools.Web.DuckDuckGo.MaxResults)
if cfg.Tools.Web.Search.QueryParam == "" {
t.Error("Search query param should not be empty by default")
}
}

View file

@ -190,7 +190,7 @@ func TestWebTool_WebSearch_NoApiKey(t *testing.T) {
// TestWebTool_WebSearch_MissingQuery verifies error handling for missing query
func TestWebTool_WebSearch_MissingQuery(t *testing.T) {
tool := NewWebSearchTool(WebSearchToolOptions{Provider: "duckduckgo", Enabled: true, MaxResults: 5})
tool := NewWebSearchTool(WebSearchToolOptions{Provider: "duckduckgo", MaxResults: 5})
ctx := context.Background()
args := map[string]interface{}{}