Skip to content

Commit

Permalink
added some more unit tests; removed duplicate import test statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Jibola committed Feb 20, 2024
1 parent 82e7eb4 commit ba82b0f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

EXPECTED_ALL = [
"MongoDBAtlasVectorSearch",
"MongoDBAtlasVectorSearch",
]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,18 @@ def collection() -> Collection:

def test_initialization(collection: Collection, embedding_openai: Embeddings) -> None:
"""Test initialization of vector store class"""
MongoDBAtlasVectorSearch(collection, embedding_openai)
assert MongoDBAtlasVectorSearch(collection, embedding_openai)


def test_init_from_connection_string(embedding_openai: Embeddings) -> None:
"""Test initialization of vector store class"""
assert MongoDBAtlasVectorSearch.from_connection_string(
CONNECTION_STRING, NAMESPACE, embedding_openai
)


def test_init_from_texts(collection: Collection, embedding_openai: Embeddings) -> None:
"""Test from_texts operation on an empty list"""
assert MongoDBAtlasVectorSearch.from_texts(
[], embedding_openai, collection=collection
)

0 comments on commit ba82b0f

Please sign in to comment.