Skip to content

Commit 33e5337

Browse files
Add async invalid-schema coverage for extract tool wrapper
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 840c7d2 commit 33e5337

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_tools_extract.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,19 @@ def test_extract_tool_runnable_raises_for_invalid_schema_json():
8888
HyperbrowserError, match="Invalid JSON string provided for `schema`"
8989
):
9090
WebsiteExtractTool.runnable(client, params)
91+
92+
93+
def test_extract_tool_async_runnable_raises_for_invalid_schema_json():
94+
client = _AsyncClient()
95+
params = {
96+
"urls": ["https://example.com"],
97+
"schema": "{invalid-json}",
98+
}
99+
100+
async def run():
101+
await WebsiteExtractTool.async_runnable(client, params)
102+
103+
with pytest.raises(
104+
HyperbrowserError, match="Invalid JSON string provided for `schema`"
105+
):
106+
asyncio.run(run())

0 commit comments

Comments
 (0)