Skip to content

Commit

Permalink
Modified search wiki test (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
HalberdOfPineapple authored Aug 29, 2023
1 parent da37bc5 commit 71d466d
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions test/functions/test_search_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
import wikipedia

from camel.functions.search_functions import search_wiki


Expand All @@ -32,17 +34,7 @@ def test_search_wiki_not_found():
"entity to be searched.")


def tests_search_wiki_with_ambiguity():
expected_output = (
"New York, often called New York State, is a state in the"
" Northeastern United States. A Mid-Atlantic state, New York"
" borders New England, and has an international border with Canada."
" With almost 19.7 million residents, it is the fourth-most populous "
"state in the United States and seventh-most densely populated as of "
"2022. New York is the 27th-largest U.S. state by area, with a total "
"area of 54,556 square miles (141,300 km2).New York has a varied "
"geography. The southeastern part of the state, known as Downstate, "
"encompasses New York City (the most populous city in the United "
"States), Long Island (the most populous island in the United States)"
", and the lower Hudson Valley.")
def test_search_wiki_with_ambiguity():
expected_output = wikipedia.summary("New York (state)", sentences=5,
auto_suggest=False)
assert search_wiki("New York") == expected_output

0 comments on commit 71d466d

Please sign in to comment.