Skip to content

Commit 86ea5fb

Browse files
ofek-kapsclaude
andcommitted
fix: use proto.set_response_params assertion in proxy test
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 parent 7268076 commit 86ea5fb

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

tests/test_proxy.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,18 +1246,14 @@ async def test_https_connect_skip_payload_on_200( # type: ignore[misc]
12461246
proxy=URL("http://proxy.example.com"),
12471247
loop=event_loop,
12481248
)
1249-
# Capture the set_response_params call on the tunnel
1250-
# protocol to verify skip_payload=True is passed.
1251-
with mock.patch(
1252-
"aiohttp.connector.ResponseHandler.set_response_params",
1253-
autospec=True,
1254-
) as set_params_mock:
1255-
await connector._create_connection(
1256-
req, [], aiohttp.ClientTimeout()
1257-
)
1249+
await connector._create_connection(
1250+
req, [], aiohttp.ClientTimeout()
1251+
)
12581252

1259-
set_params_mock.assert_called_once_with(
1260-
mock.ANY, # self
1253+
# proto is the mock protocol returned by create_connection.
1254+
# The connector calls protocol.set_response_params(...) on it
1255+
# directly, so we assert on proto's auto-mock attribute.
1256+
proto.set_response_params.assert_called_once_with(
12611257
read_until_eof=True,
12621258
timeout_ceil_threshold=mock.ANY,
12631259
skip_payload=True,

0 commit comments

Comments
 (0)