Skip to content

Commit 1c12997

Browse files
committed
test: fix test issues
1 parent 5089d52 commit 1c12997

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/unit/test_api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ def test_query():
6969
"metadatas": [[{"type": "perspective"}, {"type": "tag"}]],
7070
"documents": [["doc1 content", "doc2 content"]],
7171
}
72+
# Configure the count method to return 2
73+
mock_collection.count.return_value = 2
7274

7375
# Call the API
7476
with patch("api.get_collection", return_value=mock_collection):
@@ -91,6 +93,8 @@ def test_query():
9193

9294
# Verify collection.query was called with the embedding
9395
mock_collection.query.assert_called_once()
96+
# Verify collection.count was called twice (once for empty check, once for metadata)
97+
assert mock_collection.count.call_count == 2
9498

9599

96100
def test_query_filter():

0 commit comments

Comments
 (0)