@@ -917,30 +917,30 @@ def test_extract_response_text_object_with_text_attr(self):
917917 def test_extract_response_text_object_with_empty_text (self ):
918918 """Test extracting text from object with empty text attribute."""
919919 # Use spec to ensure only specified attributes exist
920- obj = Mock (spec = ['text' ])
920+ obj = Mock (spec_set = ['text' ])
921921 obj .text = ""
922922 result = self .manager ._extract_response_text (obj )
923923 self .assertEqual (result , "" )
924924
925925 def test_extract_response_text_agent_executor_response_with_agent_response (self ):
926926 """Test extracting text from AgentExecutorResponse with agent_response.text."""
927- agent_resp = Mock ()
927+ agent_resp = Mock (spec_set = [ 'text' ] )
928928 agent_resp .text = "Agent executor response"
929929
930- executor_resp = Mock (spec = ['agent_response' ])
930+ executor_resp = Mock (spec_set = ['agent_response' ])
931931 executor_resp .agent_response = agent_resp
932932
933933 result = self .manager ._extract_response_text (executor_resp )
934934 self .assertEqual (result , "Agent executor response" )
935935
936936 def test_extract_response_text_agent_executor_response_fallback_to_conversation (self ):
937937 """Test extracting text from AgentExecutorResponse falling back to full_conversation."""
938- agent_resp = Mock ()
938+ agent_resp = Mock (spec_set = [ 'text' ] )
939939 agent_resp .text = None
940940
941941 last_msg = MockChatMessage ("Last conversation message" )
942942
943- executor_resp = Mock (spec = ['agent_response' , 'full_conversation' ])
943+ executor_resp = Mock (spec_set = ['agent_response' , 'full_conversation' ])
944944 executor_resp .agent_response = agent_resp
945945 executor_resp .full_conversation = [MockChatMessage ("First" ), last_msg ]
946946
@@ -949,10 +949,10 @@ def test_extract_response_text_agent_executor_response_fallback_to_conversation(
949949
950950 def test_extract_response_text_agent_executor_response_empty_conversation (self ):
951951 """Test extracting text from AgentExecutorResponse with empty conversation."""
952- agent_resp = Mock ()
952+ agent_resp = Mock (spec_set = [ 'text' ] )
953953 agent_resp .text = None
954954
955- executor_resp = Mock (spec = ['agent_response' , 'full_conversation' ])
955+ executor_resp = Mock (spec_set = ['agent_response' , 'full_conversation' ])
956956 executor_resp .agent_response = agent_resp
957957 executor_resp .full_conversation = []
958958
@@ -1091,7 +1091,7 @@ async def test_workflow_output_with_object_with_text(self):
10911091 mock_workflow = Mock ()
10921092
10931093 # Create object with text attribute
1094- obj_with_text = Mock (spec = ['text' ])
1094+ obj_with_text = Mock (spec_set = ['text' ])
10951095 obj_with_text .text = "Object response"
10961096 output_event = MockWorkflowOutputEvent (obj_with_text )
10971097
0 commit comments