Optimization
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""Unit tests for ConversationManagerService."""
|
||||
|
||||
import asyncio
|
||||
from datetime import UTC, datetime, timedelta
|
||||
from typing import Literal
|
||||
from unittest.mock import AsyncMock, Mock, patch
|
||||
@@ -471,6 +472,7 @@ class TestQuickReplyPath:
|
||||
session=sample_session,
|
||||
)
|
||||
|
||||
await asyncio.sleep(0.01) # Let fire-and-forget background tasks complete
|
||||
assert mock_firestore.save_entry.await_count == 2
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -499,6 +501,7 @@ class TestQuickReplyPath:
|
||||
session=sample_session,
|
||||
)
|
||||
|
||||
await asyncio.sleep(0.01) # Let fire-and-forget background tasks complete
|
||||
mock_firestore.save_session.assert_awaited_once()
|
||||
mock_redis.save_session.assert_awaited_once()
|
||||
|
||||
@@ -571,6 +574,7 @@ class TestStandardConversation:
|
||||
session=sample_session,
|
||||
)
|
||||
|
||||
await asyncio.sleep(0.01) # Let fire-and-forget background tasks complete
|
||||
assert mock_firestore.save_entry.await_count == 2
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -588,6 +592,7 @@ class TestStandardConversation:
|
||||
session=sample_session,
|
||||
)
|
||||
|
||||
await asyncio.sleep(0.01) # Let fire-and-forget background tasks complete
|
||||
# save_session is called in _update_session_after_turn
|
||||
assert mock_firestore.save_session.await_count >= 1
|
||||
assert mock_redis.save_session.await_count >= 1
|
||||
@@ -611,6 +616,7 @@ class TestStandardConversation:
|
||||
session=sample_session,
|
||||
)
|
||||
|
||||
await asyncio.sleep(0.01) # Let fire-and-forget background tasks complete
|
||||
mock_firestore.update_notification_status.assert_awaited_once()
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user