@@ -1114,8 +1114,8 @@ async def test_update_tool_extra_fields(self, tool_service, mock_tool, test_db):
11141114 # Mock DB get to return None
11151115 mock_tool .id = "999"
11161116 test_db .get = Mock (return_value = mock_tool )
1117- test_db .commit = AsyncMock ()
1118- test_db .refresh = AsyncMock ()
1117+ test_db .commit = Mock () # SQLAlchemy commit is synchronous
1118+ test_db .refresh = Mock () # SQLAlchemy refresh is synchronous
11191119
11201120 # Create update request
11211121 tool_update = ToolUpdate (integration_type = "REST" , request_type = "POST" , headers = {"key" : "value" }, input_schema = {"key2" : "value2" }, annotations = {"key3" : "value3" }, jsonpath_filter = "test_filter" )
@@ -1136,8 +1136,8 @@ async def test_update_tool_basic_auth(self, tool_service, mock_tool, test_db):
11361136 # Mock DB get to return None
11371137 mock_tool .id = "999"
11381138 test_db .get = Mock (return_value = mock_tool )
1139- test_db .commit = AsyncMock ()
1140- test_db .refresh = AsyncMock ()
1139+ test_db .commit = Mock () # SQLAlchemy commit is synchronous
1140+ test_db .refresh = Mock () # SQLAlchemy refresh is synchronous
11411141
11421142 # Basic auth_value
11431143 # Create auth_value with the following values
@@ -1162,8 +1162,8 @@ async def test_update_tool_bearer_auth(self, tool_service, mock_tool, test_db):
11621162 # Mock DB get to return None
11631163 mock_tool .id = "999"
11641164 test_db .get = Mock (return_value = mock_tool )
1165- test_db .commit = AsyncMock ()
1166- test_db .refresh = AsyncMock ()
1165+ test_db .commit = Mock () # SQLAlchemy commit is synchronous
1166+ test_db .refresh = Mock () # SQLAlchemy refresh is synchronous
11671167
11681168 # Bearer auth_value
11691169 # Create auth_value with the following values
@@ -1183,8 +1183,8 @@ async def test_update_tool_empty_auth(self, tool_service, mock_tool, test_db):
11831183 # Mock DB get to return None
11841184 mock_tool .id = "999"
11851185 test_db .get = Mock (return_value = mock_tool )
1186- test_db .commit = AsyncMock ()
1187- test_db .refresh = AsyncMock ()
1186+ test_db .commit = Mock () # SQLAlchemy commit is synchronous
1187+ test_db .refresh = Mock () # SQLAlchemy refresh is synchronous
11881188
11891189 # Create update request
11901190 tool_update = ToolUpdate (auth = AuthenticationValues ())
@@ -1243,7 +1243,7 @@ async def test_invoke_tool_rest_get(self, tool_service, mock_tool, test_db):
12431243
12441244 # --------------- HTTP ------------------
12451245 mock_response = AsyncMock ()
1246- mock_response .raise_for_status = AsyncMock ()
1246+ mock_response .raise_for_status = Mock () # HTTP response raise_for_status is synchronous
12471247 mock_response .status_code = 200
12481248 # <-- make json() *synchronous*
12491249 mock_response .json = Mock (return_value = {"result" : "REST tool response" })
@@ -1268,7 +1268,7 @@ async def test_invoke_tool_rest_get(self, tool_service, mock_tool, test_db):
12681268
12691269 # Test 204 status
12701270 mock_response = AsyncMock ()
1271- mock_response .raise_for_status = AsyncMock ()
1271+ mock_response .raise_for_status = Mock () # HTTP response raise_for_status is synchronous
12721272 mock_response .status_code = 204
12731273 mock_response .json = Mock (return_value = ToolResult (content = [TextContent (type = "text" , text = "Request completed successfully (No Content)" )]))
12741274
@@ -1284,7 +1284,7 @@ async def test_invoke_tool_rest_get(self, tool_service, mock_tool, test_db):
12841284
12851285 # Test 205 status
12861286 mock_response = AsyncMock ()
1287- mock_response .raise_for_status = AsyncMock ()
1287+ mock_response .raise_for_status = Mock () # HTTP response raise_for_status is synchronous
12881288 mock_response .status_code = 205
12891289 mock_response .json = Mock (return_value = ToolResult (content = [TextContent (type = "text" , text = "Tool error encountered" )]))
12901290
@@ -1314,7 +1314,7 @@ async def test_invoke_tool_rest_post(self, tool_service, mock_tool, test_db):
13141314
13151315 # Mock HTTP client response
13161316 mock_response = AsyncMock ()
1317- mock_response .raise_for_status = AsyncMock ()
1317+ mock_response .raise_for_status = Mock () # HTTP response raise_for_status is synchronous
13181318 mock_response .status_code = 200
13191319 mock_response .json = Mock (return_value = {"result" : "REST tool response" }) # Make json() synchronous
13201320 tool_service ._http_client .request .return_value = mock_response
@@ -2038,7 +2038,7 @@ async def test_invoke_tool_rest_oauth_success(self, tool_service, mock_tool, tes
20382038
20392039 # Mock HTTP client response
20402040 mock_response = AsyncMock ()
2041- mock_response .raise_for_status = AsyncMock ()
2041+ mock_response .raise_for_status = Mock () # HTTP response raise_for_status is synchronous
20422042 mock_response .status_code = 200
20432043 mock_response .json = Mock (return_value = {"result" : "OAuth success" })
20442044 tool_service ._http_client .request .return_value = mock_response
@@ -2150,7 +2150,7 @@ async def test_invoke_tool_with_passthrough_headers_rest(self, tool_service, moc
21502150
21512151 # Mock HTTP client response
21522152 mock_response = AsyncMock ()
2153- mock_response .raise_for_status = AsyncMock ()
2153+ mock_response .raise_for_status = Mock () # HTTP response raise_for_status is synchronous
21542154 mock_response .status_code = 200
21552155 mock_response .json = Mock (return_value = {"result" : "success with headers" })
21562156 tool_service ._http_client .request .return_value = mock_response
@@ -2242,7 +2242,7 @@ async def test_invoke_tool_with_plugin_post_invoke_success(self, tool_service, m
22422242
22432243 # Mock HTTP client response
22442244 mock_response = AsyncMock ()
2245- mock_response .raise_for_status = AsyncMock ()
2245+ mock_response .raise_for_status = Mock () # HTTP response raise_for_status is synchronous
22462246 mock_response .status_code = 200
22472247 mock_response .json = Mock (return_value = {"result" : "original response" })
22482248 tool_service ._http_client .request .return_value = mock_response
@@ -2283,7 +2283,7 @@ async def test_invoke_tool_with_plugin_post_invoke_modified_payload(self, tool_s
22832283
22842284 # Mock HTTP client response
22852285 mock_response = AsyncMock ()
2286- mock_response .raise_for_status = AsyncMock ()
2286+ mock_response .raise_for_status = Mock () # HTTP response raise_for_status is synchronous
22872287 mock_response .status_code = 200
22882288 mock_response .json = Mock (return_value = {"result" : "original response" })
22892289 tool_service ._http_client .request .return_value = mock_response
@@ -2327,7 +2327,7 @@ async def test_invoke_tool_with_plugin_post_invoke_invalid_modified_payload(self
23272327
23282328 # Mock HTTP client response
23292329 mock_response = AsyncMock ()
2330- mock_response .raise_for_status = AsyncMock ()
2330+ mock_response .raise_for_status = Mock () # HTTP response raise_for_status is synchronous
23312331 mock_response .status_code = 200
23322332 mock_response .json = Mock (return_value = {"result" : "original response" })
23332333 tool_service ._http_client .request .return_value = mock_response
@@ -2371,7 +2371,7 @@ async def test_invoke_tool_with_plugin_post_invoke_error_fail_on_error(self, too
23712371
23722372 # Mock HTTP client response
23732373 mock_response = AsyncMock ()
2374- mock_response .raise_for_status = AsyncMock ()
2374+ mock_response .raise_for_status = Mock () # HTTP response raise_for_status is synchronous
23752375 mock_response .status_code = 200
23762376 mock_response .json = Mock (return_value = {"result" : "original response" })
23772377 tool_service ._http_client .request .return_value = mock_response
@@ -2414,7 +2414,7 @@ async def test_invoke_tool_with_plugin_metadata_rest(self, tool_service, mock_to
24142414
24152415 # Mock HTTP client response
24162416 mock_response = AsyncMock ()
2417- mock_response .raise_for_status = AsyncMock ()
2417+ mock_response .raise_for_status = Mock () # HTTP response raise_for_status is synchronous
24182418 mock_response .status_code = 200
24192419 mock_response .json = Mock (return_value = {"result" : "original response" })
24202420 tool_service ._http_client .request .return_value = mock_response
0 commit comments