We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5089d52 commit 1c12997Copy full SHA for 1c12997
tests/unit/test_api.py
@@ -69,6 +69,8 @@ def test_query():
69
"metadatas": [[{"type": "perspective"}, {"type": "tag"}]],
70
"documents": [["doc1 content", "doc2 content"]],
71
}
72
+ # Configure the count method to return 2
73
+ mock_collection.count.return_value = 2
74
75
# Call the API
76
with patch("api.get_collection", return_value=mock_collection):
@@ -91,6 +93,8 @@ def test_query():
91
93
92
94
# Verify collection.query was called with the embedding
95
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
98
99
100
def test_query_filter():
0 commit comments