Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
mpangrazzi committed Dec 3, 2024
1 parent 3fba143 commit dad3f36
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions integrations/mongodb_atlas/tests/test_fulltext_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing import List, Union
from unittest.mock import MagicMock

from haystack import Document
import pytest

from haystack_integrations.document_stores.mongodb_atlas import MongoDBAtlasDocumentStore
Expand All @@ -26,6 +27,18 @@ def document_store(self) -> MongoDBAtlasDocumentStore:
full_text_search_index="full_text_index",
)

@pytest.fixture(autouse=True)
def setup_teardown(self, document_store):
document_store.collection.delete_many({})
document_store.write_documents([
Document(content="The quick brown fox chased the dog", meta={"meta_field": "right_value"}),
Document(content="The fox was brown", meta={"meta_field": "right_value"}),
Document(content="The lazy dog"),
Document(content="fox fox fox"),
])

yield

def test_pipeline_correctly_passes_parameters(self, document_store: MongoDBAtlasDocumentStore):
mock_collection = MagicMock()
document_store._collection = mock_collection
Expand Down

0 comments on commit dad3f36

Please sign in to comment.