Skip to content

Commit

Permalink
fixed test_retriever_tool.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Izuki Matsuba committed Mar 29, 2024
1 parent f9e9a99 commit 0d9694b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions llama-index-core/tests/tools/test_retriever_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ def test_retriever_tool() -> None:
retriever = MockRetriever()
retriever_tool = RetrieverTool.from_defaults(retriever=retriever)
response_nodes = retriever_tool("hello world")
assert str(response_nodes) == "mock_hello world"
assert response_nodes.raw_output[0].node.text == "mock_hello world"
assert str(response_nodes) == "mock_hello world\n\n\n\n"
assert response_nodes.raw_output[0].node.text == "mock_hello world\n\n"

# Test node_postprocessors
node_postprocessors = MockPostProcessor()
node_postprocessors = [MockPostProcessor()]
pr_retriever_tool = RetrieverTool.from_defaults(
retriever=retriever, node_postprocessors=node_postprocessors
)
pr_response_nodes = pr_retriever_tool("hello world")
assert str(pr_response_nodes) == "processed_mock_hello world"
assert str(pr_response_nodes) == "processed_mock_hello world\n\n\n\n"


# test_retriever_tool()

0 comments on commit 0d9694b

Please sign in to comment.