mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-04 04:07:54 +00:00
## Description Added integration TCs on bing search utility ## Issue #8068 ## Dependencies None
This commit is contained in:
parent
e2e05ad89e
commit
52a3e8a261
@ -0,0 +1,19 @@
|
|||||||
|
"""Integration test for Bing Search API Wrapper."""
|
||||||
|
from langchain.utilities.bing_search import BingSearchAPIWrapper
|
||||||
|
|
||||||
|
|
||||||
|
def test_call() -> None:
|
||||||
|
"""Test that call gives the correct answer."""
|
||||||
|
search = BingSearchAPIWrapper()
|
||||||
|
output = search.run("Obama's first name")
|
||||||
|
assert "Barack Hussein Obama" in output
|
||||||
|
|
||||||
|
|
||||||
|
def test_results() -> None:
|
||||||
|
"""Test that call gives the correct answer."""
|
||||||
|
search = BingSearchAPIWrapper()
|
||||||
|
results = search.results("Obama's first name", num_results=5)
|
||||||
|
result_contents = "\n".join(
|
||||||
|
f"{result['title']}: {result['snippet']}" for result in results
|
||||||
|
)
|
||||||
|
assert "Barack Hussein Obama" in result_contents
|
Loading…
Reference in New Issue
Block a user