Skip to content

Commit 2aaee74

Browse files
committed
fix: tests
1 parent 7b6f35c commit 2aaee74

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/agent/tools/test_tool_node.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Tests for tool_node.py module."""
22

3+
import json
34
from typing import Any, Dict
45
from unittest.mock import patch
56

@@ -533,7 +534,7 @@ def test_cancelled_returns_cancelled_message(
533534
assert isinstance(result, dict)
534535
msg = result["messages"][0]
535536
assert isinstance(msg, ToolMessage)
536-
assert msg.content == CANCELLED_MESSAGE
537+
assert msg.content == json.dumps({"meta": CANCELLED_MESSAGE})
537538

538539
@patch(
539540
"uipath_langchain.chat.hitl.request_approval",
@@ -568,7 +569,6 @@ def test_approved_modified_args_injects_meta(
568569
assert result is not None
569570
assert isinstance(result, dict)
570571
msg = result["messages"][0]
571-
import json
572572

573573
assert isinstance(msg.content, str)
574574
wrapped = json.loads(msg.content)
@@ -588,7 +588,7 @@ async def test_async_cancelled(
588588
assert result is not None
589589
assert isinstance(result, dict)
590590
msg = result["messages"][0]
591-
assert msg.content == CANCELLED_MESSAGE
591+
assert msg.content == json.dumps({"meta": CANCELLED_MESSAGE})
592592

593593
@patch(
594594
"uipath_langchain.chat.hitl.request_approval",
@@ -605,7 +605,6 @@ async def test_async_approved_modified_args(
605605
assert result is not None
606606
assert isinstance(result, dict)
607607
msg = result["messages"][0]
608-
import json
609608

610609
assert isinstance(msg.content, str)
611610
wrapped = json.loads(msg.content)

tests/chat/test_hitl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Tests for hitl.py module."""
22

3+
import json
34
from typing import Any
45
from unittest.mock import patch
56

@@ -60,7 +61,7 @@ def test_cancelled_returns_tool_message(self, mock_approval):
6061
assert isinstance(result, ConfirmationResult)
6162
assert result.cancelled is not None
6263
assert isinstance(result.cancelled, ToolMessage)
63-
assert result.cancelled.content == CANCELLED_MESSAGE
64+
assert result.cancelled.content == json.dumps({"meta": CANCELLED_MESSAGE})
6465
assert result.cancelled.name == "mock_tool"
6566
assert result.cancelled.tool_call_id == "call_1"
6667
assert result.args_modified is False

0 commit comments

Comments
 (0)