Skip to content

Commit b74ffc1

Browse files
Format UTF-8 regression tests for tool responses
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 6d477f4 commit b74ffc1

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

tests/test_tools_response_handling.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,9 @@ def test_browser_use_tool_decodes_utf8_bytes_final_result():
553553

554554

555555
def test_browser_use_tool_wraps_invalid_utf8_bytes_final_result():
556-
client = _SyncBrowserUseClient(_Response(data=SimpleNamespace(final_result=b"\xff")))
556+
client = _SyncBrowserUseClient(
557+
_Response(data=SimpleNamespace(final_result=b"\xff"))
558+
)
557559

558560
with pytest.raises(
559561
HyperbrowserError,
@@ -645,7 +647,9 @@ async def run() -> None:
645647

646648
def test_async_screenshot_tool_decodes_utf8_bytes_field():
647649
async def run() -> None:
648-
client = _AsyncScrapeClient(_Response(data=SimpleNamespace(screenshot=b"async-shot")))
650+
client = _AsyncScrapeClient(
651+
_Response(data=SimpleNamespace(screenshot=b"async-shot"))
652+
)
649653
output = await WebsiteScreenshotTool.async_runnable(
650654
client,
651655
{"url": "https://example.com"},
@@ -663,8 +667,7 @@ async def run() -> None:
663667
with pytest.raises(
664668
HyperbrowserError,
665669
match=(
666-
"browser-use tool response field "
667-
"'final_result' must be a UTF-8 string"
670+
"browser-use tool response field 'final_result' must be a UTF-8 string"
668671
),
669672
) as exc_info:
670673
await BrowserUseTool.async_runnable(client, {"task": "search docs"})

0 commit comments

Comments
 (0)