File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
packages/toolbox-core/tests Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -133,11 +133,14 @@ async def test_run_tool_unauth_with_auth(
133
133
self , toolbox : ToolboxClient , auth_token2 : str
134
134
):
135
135
"""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
+ )
141
144
142
145
async def test_run_tool_no_auth (self , toolbox : ToolboxClient ):
143
146
"""Tests running a tool requiring auth without providing auth."""
Original file line number Diff line number Diff line change @@ -115,11 +115,14 @@ def test_run_tool_unauth_with_auth(
115
115
self , toolbox : ToolboxSyncClient , auth_token2 : str
116
116
):
117
117
"""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
+ )
123
126
124
127
def test_run_tool_no_auth (self , toolbox : ToolboxSyncClient ):
125
128
"""Tests running a tool requiring auth without providing auth."""
You can’t perform that action at this time.
0 commit comments