|
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,10 @@ 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( |
| 190 | + value="test@example.com", type=TaskRecipientType.EMAIL |
| 191 | + ) |
188 | 192 | assert call_args.data["GuardrailName"] == "Test Guardrail" |
189 | 193 | assert call_args.data["GuardrailDescription"] == "Test description" |
190 | 194 | assert call_args.data["ExecutionStage"] == expected_stage |
@@ -248,7 +252,10 @@ async def test_node_post_agent_interrupts_with_correct_agent_result_data( |
248 | 252 | assert call_args.app_name == "TestApp" |
249 | 253 | assert call_args.app_folder_path == "TestFolder" |
250 | 254 | assert call_args.title == "Agents Guardrail Task" |
251 | | - assert call_args.assignee == "test@example.com" |
| 255 | + assert call_args.assignee == "" |
| 256 | + assert call_args.recipient == TaskRecipient( |
| 257 | + value="test@example.com", type=TaskRecipientType.EMAIL |
| 258 | + ) |
252 | 259 | assert call_args.data["GuardrailName"] == "Test Guardrail" |
253 | 260 | assert call_args.data["GuardrailDescription"] == "Test description" |
254 | 261 | assert call_args.data["ExecutionStage"] == "PostExecution" |
@@ -1524,10 +1531,22 @@ async def test_validate_message_count_empty_messages_raises_exception(self): |
1524 | 1531 | @pytest.mark.parametrize( |
1525 | 1532 | "recipient,expected_value", |
1526 | 1533 | [ |
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"), |
| 1534 | + ( |
| 1535 | + STANDARD_USER_EMAIL_RECIPIENT, |
| 1536 | + TaskRecipient(value="user@example.com", type=TaskRecipientType.EMAIL), |
| 1537 | + ), |
| 1538 | + ( |
| 1539 | + STANDARD_GROUP_NAME_RECIPIENT, |
| 1540 | + TaskRecipient(value="AdminGroup", type=TaskRecipientType.GROUP_NAME), |
| 1541 | + ), |
| 1542 | + ( |
| 1543 | + ASSET_USER_EMAIL_RECIPIENT, |
| 1544 | + TaskRecipient(value="user@example.com", type=TaskRecipientType.EMAIL), |
| 1545 | + ), |
| 1546 | + ( |
| 1547 | + ASSET_GROUP_NAME_RECIPIENT, |
| 1548 | + TaskRecipient(value="AdminGroup", type=TaskRecipientType.GROUP_NAME), |
| 1549 | + ), |
1531 | 1550 | ], |
1532 | 1551 | ) |
1533 | 1552 | @patch( |
@@ -1575,7 +1594,7 @@ async def test_node_resolves_recipient_correctly( |
1575 | 1594 | # Verify interrupt was called with the resolved assignee |
1576 | 1595 | assert mock_interrupt.called |
1577 | 1596 | call_args = mock_interrupt.call_args[0][0] |
1578 | | - assert call_args.assignee == expected_value |
| 1597 | + assert call_args.recipient == expected_value |
1579 | 1598 |
|
1580 | 1599 | @pytest.mark.asyncio |
1581 | 1600 | @patch( |
|
0 commit comments