Fixed legacy web search test files
This commit is contained in:
parent
d43068fbf0
commit
9b88714be0
2 changed files with 16 additions and 6 deletions
|
|
@ -136,11 +136,15 @@ func TestDefaultConfig_WebTools(t *testing.T) {
|
|||
cfg := DefaultConfig()
|
||||
|
||||
// Verify web tools defaults
|
||||
if cfg.Tools.Web.Search.MaxResults != 5 {
|
||||
t.Error("Expected MaxResults 5, got ", cfg.Tools.Web.Search.MaxResults)
|
||||
if cfg.Tools.Web.Brave.MaxResults != 5 {
|
||||
t.Error("Expected Brave MaxResults 5, got ", cfg.Tools.Web.Brave.MaxResults)
|
||||
}
|
||||
if cfg.Tools.Web.Search.APIKey != "" {
|
||||
t.Error("Search API key should be empty by default")
|
||||
if cfg.Tools.Web.Brave.APIKey != "" {
|
||||
t.Error("Brave API key should be empty by default")
|
||||
}
|
||||
|
||||
if cfg.Tools.Web.DuckDuckGo.MaxResults != 5 {
|
||||
t.Error("Expected DuckDuckGo MaxResults 5, got ", cfg.Tools.Web.DuckDuckGo.MaxResults)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,10 @@ func TestWebTool_WebFetch_Truncation(t *testing.T) {
|
|||
|
||||
// TestWebTool_WebSearch_NoApiKey verifies error handling when API key is missing
|
||||
func TestWebTool_WebSearch_NoApiKey(t *testing.T) {
|
||||
tool := NewWebSearchTool("", 5)
|
||||
tool := NewWebSearchTool(WebSearchToolOptions{
|
||||
BraveAPIKey: "", // no api key test
|
||||
BraveMaxResults: 5,
|
||||
})
|
||||
ctx := context.Background()
|
||||
args := map[string]interface{}{
|
||||
"query": "test",
|
||||
|
|
@ -196,7 +199,10 @@ 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("test-key", 5)
|
||||
tool := NewWebSearchTool(WebSearchToolOptions{
|
||||
BraveAPIKey: "test-key", // no api key test
|
||||
BraveMaxResults: 5,
|
||||
})
|
||||
ctx := context.Background()
|
||||
args := map[string]interface{}{}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue