refactor: Update unit tests
This commit is contained in:
parent
e65a6a1679
commit
f356369708
3 changed files with 15 additions and 5 deletions
|
|
@ -35,7 +35,9 @@ async def test_get_context_success(mock_vector_engine):
|
||||||
assert len(context) == 2
|
assert len(context) == 2
|
||||||
assert context[0]["text"] == "Steve Rodger"
|
assert context[0]["text"] == "Steve Rodger"
|
||||||
assert context[1]["text"] == "Mike Broski"
|
assert context[1]["text"] == "Mike Broski"
|
||||||
mock_vector_engine.search.assert_awaited_once_with("DocumentChunk_text", "test query", limit=5)
|
mock_vector_engine.search.assert_awaited_once_with(
|
||||||
|
"DocumentChunk_text", "test query", limit=5, include_payload=True
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|
@ -87,7 +89,9 @@ async def test_get_context_top_k_limit(mock_vector_engine):
|
||||||
context = await retriever.get_context("test query")
|
context = await retriever.get_context("test query")
|
||||||
|
|
||||||
assert len(context) == 3
|
assert len(context) == 3
|
||||||
mock_vector_engine.search.assert_awaited_once_with("DocumentChunk_text", "test query", limit=3)
|
mock_vector_engine.search.assert_awaited_once_with(
|
||||||
|
"DocumentChunk_text", "test query", limit=3, include_payload=True
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,9 @@ async def test_get_context_success(mock_vector_engine):
|
||||||
assert len(context) == 2
|
assert len(context) == 2
|
||||||
assert context[0]["text"] == "S.R."
|
assert context[0]["text"] == "S.R."
|
||||||
assert context[1]["text"] == "M.B."
|
assert context[1]["text"] == "M.B."
|
||||||
mock_vector_engine.search.assert_awaited_once_with("TextSummary_text", "test query", limit=5)
|
mock_vector_engine.search.assert_awaited_once_with(
|
||||||
|
"TextSummary_text", "test query", limit=5, include_payload=True
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|
@ -87,7 +89,9 @@ async def test_get_context_top_k_limit(mock_vector_engine):
|
||||||
context = await retriever.get_context("test query")
|
context = await retriever.get_context("test query")
|
||||||
|
|
||||||
assert len(context) == 3
|
assert len(context) == 3
|
||||||
mock_vector_engine.search.assert_awaited_once_with("TextSummary_text", "test query", limit=3)
|
mock_vector_engine.search.assert_awaited_once_with(
|
||||||
|
"TextSummary_text", "test query", limit=3, include_payload=True
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,9 @@ async def test_get_context_success(mock_vector_engine):
|
||||||
context = await retriever.get_context("test query")
|
context = await retriever.get_context("test query")
|
||||||
|
|
||||||
assert context == "Alice knows Bob\nBob works at Tech Corp"
|
assert context == "Alice knows Bob\nBob works at Tech Corp"
|
||||||
mock_vector_engine.search.assert_awaited_once_with("Triplet_text", "test query", limit=5)
|
mock_vector_engine.search.assert_awaited_once_with(
|
||||||
|
"Triplet_text", "test query", limit=5, include_payload=True
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue