test(api): add autospec to MagicMock-based patch usage (#32752)

This commit is contained in:
-LAN-
2026-03-01 04:30:45 +08:00
committed by GitHub
parent c034eb036c
commit 20fcc95db9
86 changed files with 865 additions and 804 deletions

View File

@ -237,9 +237,9 @@ class TestConversationServiceSummarization:
titles based on the first message.
"""
@patch("services.conversation_service.db.session")
@patch("services.conversation_service.ConversationService.get_conversation")
@patch("services.conversation_service.ConversationService.auto_generate_name")
@patch("services.conversation_service.db.session", autospec=True)
@patch("services.conversation_service.ConversationService.get_conversation", autospec=True)
@patch("services.conversation_service.ConversationService.auto_generate_name", autospec=True)
def test_rename_with_auto_generate(self, mock_auto_generate, mock_get_conversation, mock_db_session):
"""
Test renaming conversation with auto-generation enabled.