Skip to content

Commit 4a15919

Browse files
committed
fix path
Signed-off-by: Anxhela Coba <acoba@redhat.com>
1 parent de6e829 commit 4a15919

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/unit/utils/test_vector_search.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,7 @@ async def test_reranker_enabled_calls_cross_encoder(
745745
config_mock.reranker.enabled = True
746746
config_mock.reranker.model = "test-model"
747747
mocker.patch("utils.vector_search.configuration", config_mock)
748+
mocker.patch("utils.reranker.configuration", config_mock)
748749

749750
# Mock BYOK search response
750751
chunk_mock = mocker.Mock()
@@ -760,7 +761,7 @@ async def test_reranker_enabled_calls_cross_encoder(
760761
client_mock.vector_io.query.return_value = search_response
761762

762763
# Mock cross-encoder reranking function
763-
mock_rerank = mocker.patch("utils.reranker.rerank_chunks_with_cross_encoder")
764+
mock_rerank = mocker.patch("utils.vector_search.rerank_chunks_with_cross_encoder")
764765
mock_rerank.return_value = [
765766
RAGChunk(content="BYOK content", source="rag_1", score=0.95)
766767
]
@@ -833,6 +834,7 @@ async def test_loads_model_successfully(self, mocker: MockerFixture) -> None:
833834
mock_config = mocker.Mock()
834835
mock_config.reranker.enabled = True
835836
mocker.patch("utils.vector_search.configuration", mock_config)
837+
mocker.patch("utils.reranker.configuration", mock_config)
836838

837839
# Mock the CrossEncoder class by patching the import
838840
mock_model_instance = mocker.Mock()
@@ -864,6 +866,7 @@ async def test_caches_loaded_model(self, mocker: MockerFixture) -> None:
864866
mock_config = mocker.Mock()
865867
mock_config.reranker.enabled = True
866868
mocker.patch("utils.vector_search.configuration", mock_config)
869+
mocker.patch("utils.reranker.configuration", mock_config)
867870

868871
mock_model_instance = mocker.Mock()
869872
mock_cross_encoder = mocker.Mock(return_value=mock_model_instance)
@@ -897,6 +900,7 @@ async def test_handles_import_error(self, mocker: MockerFixture) -> None:
897900
mock_config = mocker.Mock()
898901
mock_config.reranker.enabled = True
899902
mocker.patch("utils.vector_search.configuration", mock_config)
903+
mocker.patch("utils.reranker.configuration", mock_config)
900904

901905
# Mock asyncio.to_thread to raise an exception
902906
mocker.patch("asyncio.to_thread", side_effect=Exception("Model loading failed"))
@@ -918,6 +922,7 @@ async def test_handles_model_loading_error(self, mocker: MockerFixture) -> None:
918922
mock_config = mocker.Mock()
919923
mock_config.reranker.enabled = True
920924
mocker.patch("utils.vector_search.configuration", mock_config)
925+
mocker.patch("utils.reranker.configuration", mock_config)
921926

922927
# Mock asyncio.to_thread to raise an exception
923928
mocker.patch("asyncio.to_thread", side_effect=Exception("Model loading failed"))

0 commit comments

Comments
 (0)