Skip to content

Commit

Permalink
updating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
whitead committed Oct 12, 2023
1 parent 208b0d6 commit 504d554
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/test_paperqa.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def test_bad_context():
f.write(r.text)
docs = Docs()
docs.add(doc_path, "WikiMedia Foundation, 2023, Accessed now")
answer = docs.query("What year was Barack Obama born?")
answer = docs.query("What is the radius of Jupyter?")
assert "cannot answer" in answer.answer
os.remove(doc_path)

Expand Down Expand Up @@ -731,6 +731,7 @@ def test_memory():
"I cannot answer" in answer3.answer
or "insufficient" in answer3.answer
or "does not provide" in answer3.answer
or "ambiguous" in answer3.answer
)


Expand Down Expand Up @@ -792,16 +793,16 @@ def test_external_texts_index():
"https://en.wikipedia.org/wiki/National_Flag_of_Canada_Day",
citation="Flag Day of Canada, WikiMedia Foundation, 2023, Accessed now",
)
answer = docs.query(query="What is the date of flag day?", key_filter=True)
answer = docs.query(query="What is the date of flag day?")
print(answer.context)
print(answer)
assert "February 15" in answer.answer

docs.add_url(
"https://en.wikipedia.org/wiki/Frederick_Bates_(politician)",
citation="Fredrick Bates, WikiMedia Foundation, 2023, Accessed now",
)

answer = docs.query(query="What is the date of flag day?", key_filter=False)
assert "February 15" in answer.answer

answer = docs.query(query="What is the date of flag day?", key_filter=True)
print(answer.context)
assert "February 15" in answer.answer

0 comments on commit 504d554

Please sign in to comment.