mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-17 23:41:46 +00:00
Harrison/serper api bug (#4902)
Co-authored-by: Jerry Luan <xmaswillyou@gmail.com>
This commit is contained in:
@@ -4,13 +4,20 @@ import pytest
|
||||
from langchain.utilities.google_serper import GoogleSerperAPIWrapper
|
||||
|
||||
|
||||
def test_call() -> None:
|
||||
"""Test that call gives the correct answer."""
|
||||
def test_search_call() -> None:
|
||||
"""Test that call gives the correct answer from search."""
|
||||
search = GoogleSerperAPIWrapper()
|
||||
output = search.run("What was Obama's first name?")
|
||||
assert "Barack Hussein Obama II" in output
|
||||
|
||||
|
||||
def test_news_call() -> None:
|
||||
"""Test that call gives the correct answer from news search."""
|
||||
search = GoogleSerperAPIWrapper(type="news")
|
||||
output = search.run("What's new with stock market?").lower()
|
||||
assert "stock" in output or "market" in output
|
||||
|
||||
|
||||
async def test_results() -> None:
|
||||
"""Test that call gives the correct answer."""
|
||||
search = GoogleSerperAPIWrapper()
|
||||
|
Reference in New Issue
Block a user