Skip to content

Commit 4a29501

Browse files
committed
chore: Fix integration tests.
1 parent 4e2f3cb commit 4a29501

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

packages/toolbox-core/tests/test_e2e.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,14 @@ async def test_run_tool_unauth_with_auth(
133133
self, toolbox: ToolboxClient, auth_token2: str
134134
):
135135
"""Tests running a tool that doesn't require auth, with auth provided."""
136-
tool = await toolbox.load_tool(
137-
"get-row-by-id", auth_token_getters={"my-test-auth": lambda: auth_token2}
138-
)
139-
response = await tool(id="2")
140-
assert "row2" in response
136+
137+
with pytest.raises(
138+
ValueError,
139+
match=rf"Validation failed for tool 'get-row-by-id': unused auth tokens: my-test-auth",
140+
):
141+
await toolbox.load_tool(
142+
"get-row-by-id", auth_token_getters={"my-test-auth": lambda: auth_token2}
143+
)
141144

142145
async def test_run_tool_no_auth(self, toolbox: ToolboxClient):
143146
"""Tests running a tool requiring auth without providing auth."""

packages/toolbox-core/tests/test_sync_e2e.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,14 @@ def test_run_tool_unauth_with_auth(
115115
self, toolbox: ToolboxSyncClient, auth_token2: str
116116
):
117117
"""Tests running a tool that doesn't require auth, with auth provided."""
118-
tool = toolbox.load_tool(
119-
"get-row-by-id", auth_token_getters={"my-test-auth": lambda: auth_token2}
120-
)
121-
response = tool(id="2")
122-
assert "row2" in response
118+
119+
with pytest.raises(
120+
ValueError,
121+
match=rf"Validation failed for tool 'get-row-by-id': unused auth tokens: my-test-auth",
122+
):
123+
toolbox.load_tool(
124+
"get-row-by-id", auth_token_getters={"my-test-auth": lambda: auth_token2}
125+
)
123126

124127
def test_run_tool_no_auth(self, toolbox: ToolboxSyncClient):
125128
"""Tests running a tool requiring auth without providing auth."""

0 commit comments

Comments
 (0)