Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
masci committed May 28, 2024
1 parent e7264f2 commit 7cbdaf7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion integrations/mongodb_atlas/tests/test_document_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
import os
from uuid import uuid4
from unittest.mock import patch

import pytest
from haystack.dataclasses.document import ByteStream, Document
Expand All @@ -16,13 +17,23 @@
from pymongo.driver_info import DriverInfo


@patch("haystack_integrations.document_stores.mongodb_atlas.document_store.MongoClient")
def test_init_is_lazy(_mock_client):
MongoDBAtlasDocumentStore(
mongo_connection_string=Secret.from_token("test"),
database_name="database_name",
collection_name="collection_name",
vector_search_index="cosine_index",
)
_mock_client.assert_not_called()


@pytest.mark.skipif(
"MONGO_CONNECTION_STRING" not in os.environ,
reason="No MongoDB Atlas connection string provided",
)
@pytest.mark.integration
class TestDocumentStore(DocumentStoreBaseTests):

@pytest.fixture
def document_store(self):
database_name = "haystack_integration_test"
Expand Down

0 comments on commit 7cbdaf7

Please sign in to comment.