Migrate google search to use DDGS.text function (#4383)

This commit is contained in:
Kinance
2023-05-25 01:36:23 +09:00
committed by GitHub
parent 438d3e489b
commit 5168cb5219
2 changed files with 6 additions and 5 deletions

View File

@@ -42,7 +42,7 @@ def test_google_search(query, num_results, expected_output, return_value, mocker
mock_ddg = mocker.Mock()
mock_ddg.return_value = return_value
mocker.patch("autogpt.commands.google_search.ddg", mock_ddg)
mocker.patch("autogpt.commands.google_search.DDGS.text", mock_ddg)
actual_output = google_search(query, num_results=num_results)
expected_output = safe_google_results(expected_output)
assert actual_output == expected_output