Skip to content

Commit 512ddfc

Browse files
fix: fixed some tests
1 parent b9284b9 commit 512ddfc

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

tests/agent/guardrails/actions/test_escalate_action.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
AssetRecipient,
1414
StandardRecipient,
1515
)
16+
from uipath.platform.action_center.tasks import TaskRecipient, TaskRecipientType
1617
from uipath.platform.guardrails import GuardrailScope
1718
from uipath.runtime.errors import UiPathErrorCode
1819

@@ -184,7 +185,8 @@ async def test_node_interrupts_with_correct_message_data(
184185
assert call_args.app_name == "TestApp"
185186
assert call_args.app_folder_path == "TestFolder"
186187
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)
188190
assert call_args.data["GuardrailName"] == "Test Guardrail"
189191
assert call_args.data["GuardrailDescription"] == "Test description"
190192
assert call_args.data["ExecutionStage"] == expected_stage
@@ -248,7 +250,8 @@ async def test_node_post_agent_interrupts_with_correct_agent_result_data(
248250
assert call_args.app_name == "TestApp"
249251
assert call_args.app_folder_path == "TestFolder"
250252
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)
252255
assert call_args.data["GuardrailName"] == "Test Guardrail"
253256
assert call_args.data["GuardrailDescription"] == "Test description"
254257
assert call_args.data["ExecutionStage"] == "PostExecution"
@@ -1524,10 +1527,10 @@ async def test_validate_message_count_empty_messages_raises_exception(self):
15241527
@pytest.mark.parametrize(
15251528
"recipient,expected_value",
15261529
[
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)),
15311534
],
15321535
)
15331536
@patch(
@@ -1575,7 +1578,7 @@ async def test_node_resolves_recipient_correctly(
15751578
# Verify interrupt was called with the resolved assignee
15761579
assert mock_interrupt.called
15771580
call_args = mock_interrupt.call_args[0][0]
1578-
assert call_args.assignee == expected_value
1581+
assert call_args.recipient == expected_value
15791582

15801583
@pytest.mark.asyncio
15811584
@patch(

0 commit comments

Comments
 (0)