Skip to content

Commit 39075e5

Browse files
committed
chore: Fix e2e tests
1 parent 4c32436 commit 39075e5

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

packages/toolbox-llamaindex/tests/test_e2e.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,19 @@ async def test_aload_toolset_all(self, toolbox):
9090
async def test_run_tool_async(self, get_n_rows_tool):
9191
response = await get_n_rows_tool.acall(num_rows="2")
9292

93-
assert "row1" in response
94-
assert "row2" in response
95-
assert "row3" not in response
93+
assert "row1" in response.content
94+
assert "row2" in response.content
95+
assert "row3" not in response.content
9696

9797
async def test_run_tool_sync(self, get_n_rows_tool):
9898
response = get_n_rows_tool.call(num_rows="2")
9999

100-
assert "row1" in response
101-
assert "row2" in response
102-
assert "row3" not in response
100+
assert "row1" in response.content
101+
assert "row2" in response.content
102+
assert "row3" not in response.content
103103

104104
async def test_run_tool_missing_params(self, get_n_rows_tool):
105-
with pytest.raises(ValidationError, match="Field required"):
105+
with pytest.raises(TypeError, match="missing a required argument: 'num_rows'"):
106106
await get_n_rows_tool.acall()
107107

108108
async def test_run_tool_wrong_param_type(self, get_n_rows_tool):
@@ -152,7 +152,7 @@ async def test_run_tool_auth(self, toolbox, auth_token1):
152152
)
153153
auth_tool = tool.add_auth_token_getter("my-test-auth", lambda: auth_token1)
154154
response = await auth_tool.acall(id="2")
155-
assert "row2" in response
155+
assert "row2" in response.content
156156

157157
async def test_run_tool_param_auth_no_auth(self, toolbox):
158158
"""Tests running a tool with a param requiring auth, without auth."""
@@ -170,9 +170,9 @@ async def test_run_tool_param_auth(self, toolbox, auth_token1):
170170
auth_token_getters={"my-test-auth": lambda: auth_token1},
171171
)
172172
response = await tool.acall()
173-
assert "row4" in response
174-
assert "row5" in response
175-
assert "row6" in response
173+
assert "row4" in response.content
174+
assert "row5" in response.content
175+
assert "row6" in response.content
176176

177177
async def test_run_tool_param_auth_no_field(self, toolbox, auth_token1):
178178
"""Tests running a tool with a param requiring auth, with insufficient auth."""
@@ -236,16 +236,16 @@ def test_aload_toolset_all(self, toolbox):
236236
async def test_run_tool_async(self, get_n_rows_tool):
237237
response = await get_n_rows_tool.acall(num_rows="2")
238238

239-
assert "row1" in response
240-
assert "row2" in response
241-
assert "row3" not in response
239+
assert "row1" in response.content
240+
assert "row2" in response.content
241+
assert "row3" not in response.content
242242

243243
def test_run_tool_sync(self, get_n_rows_tool):
244244
response = get_n_rows_tool.call(num_rows="2")
245245

246-
assert "row1" in response
247-
assert "row2" in response
248-
assert "row3" not in response
246+
assert "row1" in response.content
247+
assert "row2" in response.content
248+
assert "row3" not in response.content
249249

250250
def test_run_tool_missing_params(self, get_n_rows_tool):
251251
with pytest.raises(ValidationError, match="Field required"):
@@ -297,7 +297,7 @@ def test_run_tool_auth(self, toolbox, auth_token1):
297297
)
298298
auth_tool = tool.add_auth_token_getter("my-test-auth", lambda: auth_token1)
299299
response = auth_tool.call(id="2")
300-
assert "row2" in response
300+
assert "row2" in response.content
301301

302302
def test_run_tool_param_auth_no_auth(self, toolbox):
303303
"""Tests running a tool with a param requiring auth, without auth."""
@@ -315,9 +315,9 @@ def test_run_tool_param_auth(self, toolbox, auth_token1):
315315
auth_token_getters={"my-test-auth": lambda: auth_token1},
316316
)
317317
response = tool.call()
318-
assert "row4" in response
319-
assert "row5" in response
320-
assert "row6" in response
318+
assert "row4" in response.content
319+
assert "row5" in response.content
320+
assert "row6" in response.content
321321

322322
def test_run_tool_param_auth_no_field(self, toolbox, auth_token1):
323323
"""Tests running a tool with a param requiring auth, with insufficient auth."""

0 commit comments

Comments
 (0)