@@ -1048,10 +1048,9 @@ async def test_call_with_verify_options(
10481048 if expected_verify_in_call == "USE_SSL_FIXTURE" :
10491049 expected_verify_in_call = mock_ssl_context
10501050
1051- mock_response = mock .create_autospec (
1052- requests .Response , instance = True , spec_set = True
1053- )
1051+ mock_response = mock .create_autospec (requests .Response , instance = True )
10541052 mock_response .json .return_value = {"result" : "success" }
1053+ mock_response .configure_mock (status_code = 200 )
10551054
10561055 tool = RestApiTool (
10571056 name = "test_tool" ,
@@ -1084,10 +1083,9 @@ async def test_call_with_configure_verify(
10841083 sample_auth_credential ,
10851084 ):
10861085 """Test that configure_verify updates the verify setting."""
1087- mock_response = mock .create_autospec (
1088- requests .Response , instance = True , spec_set = True
1089- )
1086+ mock_response = mock .create_autospec (requests .Response , instance = True )
10901087 mock_response .json .return_value = {"result" : "success" }
1088+ mock_response .configure_mock (status_code = 200 )
10911089
10921090 tool = RestApiTool (
10931091 name = "test_tool" ,
@@ -1153,10 +1151,9 @@ async def test_call_with_header_provider(
11531151 sample_auth_credential ,
11541152 ):
11551153 """Test that header_provider adds headers to the request."""
1156- mock_response = mock .create_autospec (
1157- requests .Response , instance = True , spec_set = True
1158- )
1154+ mock_response = mock .create_autospec (requests .Response , instance = True )
11591155 mock_response .json .return_value = {"result" : "success" }
1156+ mock_response .configure_mock (status_code = 200 )
11601157
11611158 def my_header_provider (context ):
11621159 return {"X-Custom-Header" : "custom-value" , "X-Request-ID" : "12345" }
@@ -1192,10 +1189,9 @@ async def test_call_header_provider_receives_tool_context(
11921189 sample_auth_credential ,
11931190 ):
11941191 """Test that header_provider receives the tool_context."""
1195- mock_response = mock .create_autospec (
1196- requests .Response , instance = True , spec_set = True
1197- )
1192+ mock_response = mock .create_autospec (requests .Response , instance = True )
11981193 mock_response .json .return_value = {"result" : "success" }
1194+ mock_response .configure_mock (status_code = 200 )
11991195
12001196 received_context = []
12011197
@@ -1232,10 +1228,9 @@ async def test_call_without_header_provider(
12321228 sample_auth_credential ,
12331229 ):
12341230 """Test that call works without header_provider."""
1235- mock_response = mock .create_autospec (
1236- requests .Response , instance = True , spec_set = True
1237- )
1231+ mock_response = mock .create_autospec (requests .Response , instance = True )
12381232 mock_response .json .return_value = {"result" : "success" }
1233+ mock_response .configure_mock (status_code = 200 )
12391234
12401235 tool = RestApiTool (
12411236 name = "test_tool" ,
0 commit comments