Skip to content

Commit ffd382c

Browse files
committed
lint
1 parent 4e6e7f8 commit ffd382c

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

packages/toolbox-core/tests/test_tool.py

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def tool_params(self) -> list[Parameter]:
3838
default=123,
3939
annotation=Optional[int],
4040
),
41-
Parameter("req_kwarg", Parameter.KEYWORD_ONLY, annotation=bool), # Added back
41+
Parameter(
42+
"req_kwarg", Parameter.KEYWORD_ONLY, annotation=bool
43+
), # Added back
4244
]
4345

4446
@pytest.fixture
@@ -144,7 +146,10 @@ def bound_arg1_value(self) -> str:
144146

145147
@pytest.fixture
146148
def tool_with_bound_arg1(
147-
self, mock_session: MagicMock, tool_details: dict[str, Any], bound_arg1_value: str
149+
self,
150+
mock_session: MagicMock,
151+
tool_details: dict[str, Any],
152+
bound_arg1_value: str,
148153
) -> ToolboxTool:
149154
bound_params = {"arg1": bound_arg1_value}
150155
return ToolboxTool(
@@ -155,14 +160,15 @@ def tool_with_bound_arg1(
155160
params=tool_details["params"], # Use corrected params
156161
bound_params=bound_params,
157162
)
163+
158164
@pytest.mark.asyncio
159165
async def test_bound_parameter_static_value_call(
160-
self,
161-
tool_with_bound_arg1: ToolboxTool,
162-
mock_session: MagicMock,
163-
tool_details: dict[str, Any],
164-
configure_mock_response: Callable,
165-
bound_arg1_value: str,
166+
self,
167+
tool_with_bound_arg1: ToolboxTool,
168+
mock_session: MagicMock,
169+
tool_details: dict[str, Any],
170+
configure_mock_response: Callable,
171+
bound_arg1_value: str,
166172
):
167173
"""Test calling a tool with a statically bound parameter."""
168174
expected_result = "Bound call success!"
@@ -172,12 +178,18 @@ async def test_bound_parameter_static_value_call(
172178
req_kwarg_val = True # The only remaining required arg
173179

174180
# Call *without* providing arg1, but provide the others
175-
result = await tool_with_bound_arg1(opt_arg=opt_arg_val, req_kwarg=req_kwarg_val)
181+
result = await tool_with_bound_arg1(
182+
opt_arg=opt_arg_val, req_kwarg=req_kwarg_val
183+
)
176184

177185
assert result == expected_result
178186
mock_session.post.assert_called_once_with(
179187
tool_details["expected_url"],
180188
# Payload should include the bound value for arg1
181-
json={"arg1": bound_arg1_value, "opt_arg": opt_arg_val, "req_kwarg": req_kwarg_val},
189+
json={
190+
"arg1": bound_arg1_value,
191+
"opt_arg": opt_arg_val,
192+
"req_kwarg": req_kwarg_val,
193+
},
182194
)
183195
mock_session.post.return_value.__aenter__.return_value.json.assert_awaited_once()

0 commit comments

Comments
 (0)