fix(integration): init AsyncMilvusClient before MilvusIndex

Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
This commit is contained in:
Mustafa Elbehery 2025-09-08 22:00:59 +02:00
parent e7444c1d9b
commit 733d0c70fe
2 changed files with 77 additions and 22 deletions

View file

@ -40,15 +40,12 @@ async def mock_milvus_client() -> MagicMock:
"""Create a mock Milvus client with common method behaviors."""
client = MagicMock()
# Mock async collection operations
client.has_collection = AsyncMock(return_value=False) # Initially no collection
client.create_collection = AsyncMock(return_value=None)
client.drop_collection = AsyncMock(return_value=None)
# Mock async insert operation
client.insert = AsyncMock(return_value={"insert_count": 10})
# Mock async search operation
client.search = AsyncMock(
return_value=[
[