|
13 | 13 | AssetRecipient, |
14 | 14 | StandardRecipient, |
15 | 15 | ) |
| 16 | +from uipath.platform.action_center.tasks import TaskRecipient, TaskRecipientType |
16 | 17 | from uipath.platform.guardrails import GuardrailScope |
17 | 18 | from uipath.runtime.errors import UiPathErrorCode |
18 | 19 |
|
@@ -184,7 +185,8 @@ async def test_node_interrupts_with_correct_message_data( |
184 | 185 | assert call_args.app_name == "TestApp" |
185 | 186 | assert call_args.app_folder_path == "TestFolder" |
186 | 187 | assert call_args.title == "Agents Guardrail Task" |
187 | | - assert call_args.assignee == "test@example.com" |
| 188 | + assert call_args.assignee == "" |
| 189 | + assert call_args.recipient == TaskRecipient(value="test@example.com", type=TaskRecipientType.EMAIL) |
188 | 190 | assert call_args.data["GuardrailName"] == "Test Guardrail" |
189 | 191 | assert call_args.data["GuardrailDescription"] == "Test description" |
190 | 192 | assert call_args.data["ExecutionStage"] == expected_stage |
@@ -248,7 +250,8 @@ async def test_node_post_agent_interrupts_with_correct_agent_result_data( |
248 | 250 | assert call_args.app_name == "TestApp" |
249 | 251 | assert call_args.app_folder_path == "TestFolder" |
250 | 252 | assert call_args.title == "Agents Guardrail Task" |
251 | | - assert call_args.assignee == "test@example.com" |
| 253 | + assert call_args.assignee == "" |
| 254 | + assert call_args.recipient == TaskRecipient(value="test@example.com", type=TaskRecipientType.EMAIL) |
252 | 255 | assert call_args.data["GuardrailName"] == "Test Guardrail" |
253 | 256 | assert call_args.data["GuardrailDescription"] == "Test description" |
254 | 257 | assert call_args.data["ExecutionStage"] == "PostExecution" |
@@ -1524,10 +1527,10 @@ async def test_validate_message_count_empty_messages_raises_exception(self): |
1524 | 1527 | @pytest.mark.parametrize( |
1525 | 1528 | "recipient,expected_value", |
1526 | 1529 | [ |
1527 | | - (STANDARD_USER_EMAIL_RECIPIENT, "user@example.com"), |
1528 | | - (STANDARD_GROUP_NAME_RECIPIENT, "AdminGroup"), |
1529 | | - (ASSET_USER_EMAIL_RECIPIENT, "user@example.com"), |
1530 | | - (ASSET_GROUP_NAME_RECIPIENT, "AdminGroup"), |
| 1530 | + (STANDARD_USER_EMAIL_RECIPIENT, TaskRecipient(value="user@example.com", type=TaskRecipientType.EMAIL)), |
| 1531 | + (STANDARD_GROUP_NAME_RECIPIENT, TaskRecipient(value="AdminGroup", type=TaskRecipientType.GROUP_NAME)), |
| 1532 | + (ASSET_USER_EMAIL_RECIPIENT, TaskRecipient(value="user@example.com", type=TaskRecipientType.EMAIL)), |
| 1533 | + (ASSET_GROUP_NAME_RECIPIENT, TaskRecipient(value="AdminGroup", type=TaskRecipientType.GROUP_NAME)), |
1531 | 1534 | ], |
1532 | 1535 | ) |
1533 | 1536 | @patch( |
@@ -1575,7 +1578,7 @@ async def test_node_resolves_recipient_correctly( |
1575 | 1578 | # Verify interrupt was called with the resolved assignee |
1576 | 1579 | assert mock_interrupt.called |
1577 | 1580 | call_args = mock_interrupt.call_args[0][0] |
1578 | | - assert call_args.assignee == expected_value |
| 1581 | + assert call_args.recipient == expected_value |
1579 | 1582 |
|
1580 | 1583 | @pytest.mark.asyncio |
1581 | 1584 | @patch( |
|
0 commit comments