@@ -261,17 +261,41 @@ async def test_escalation_tool_metadata_has_channel_type(self, escalation_resour
261261 assert tool .metadata ["channel_type" ] == "actionCenter"
262262
263263 @pytest .mark .asyncio
264- async def test_escalation_tool_metadata_has_assignee (self , escalation_resource ):
264+ @patch ("uipath_langchain.agent.tools.escalation_tool.interrupt" )
265+ async def test_escalation_tool_metadata_has_assignee (
266+ self , mock_interrupt , escalation_resource
267+ ):
265268 """Test that metadata contains assignee when recipient is USER_EMAIL."""
269+ # Mock interrupt to return a result
270+ mock_result = MagicMock ()
271+ mock_result .action = None
272+ mock_result .data = {}
273+ mock_interrupt .return_value = mock_result
274+
266275 tool = await create_escalation_tool (escalation_resource )
276+
277+ # Invoke the tool to trigger assignee resolution
278+ await tool .ainvoke ({})
279+
267280 assert tool .metadata is not None
268281 assert tool .metadata ["assignee" ] == "user@example.com"
269282
270283 @pytest .mark .asyncio
284+ @patch ("uipath_langchain.agent.tools.escalation_tool.interrupt" )
271285 async def test_escalation_tool_metadata_assignee_none_when_no_recipients (
272- self , escalation_resource_no_recipient
286+ self , mock_interrupt , escalation_resource_no_recipient
273287 ):
274288 """Test that assignee is None when no recipients configured."""
289+ # Mock interrupt to return a result
290+ mock_result = MagicMock ()
291+ mock_result .action = None
292+ mock_result .data = {}
293+ mock_interrupt .return_value = mock_result
294+
275295 tool = await create_escalation_tool (escalation_resource_no_recipient )
296+
297+ # Invoke the tool to trigger assignee resolution
298+ await tool .ainvoke ({})
299+
276300 assert tool .metadata is not None
277301 assert tool .metadata ["assignee" ] is None
0 commit comments