Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit 1f1b4d8

Browse files
1 parent 626160a commit 1f1b4d8

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

tests/unit/asyncio/test_async_read_object_stream.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,17 @@ async def test_recv_without_open_should_raise_error(
275275
# assert
276276
assert str(exc.value) == "Stream is not open"
277277

278-
@mock.patch("google.cloud.storage._experimental.asyncio.async_read_object_stream.AsyncBidiRpc")
279-
@mock.patch("google.cloud.storage._experimental.asyncio.async_grpc_client.AsyncGrpcClient.grpc_client")
278+
279+
@mock.patch(
280+
"google.cloud.storage._experimental.asyncio.async_read_object_stream.AsyncBidiRpc"
281+
)
282+
@mock.patch(
283+
"google.cloud.storage._experimental.asyncio.async_grpc_client.AsyncGrpcClient.grpc_client"
284+
)
280285
@pytest.mark.asyncio
281-
async def test_recv_updates_read_handle_on_refresh(mock_client, mock_cls_async_bidi_rpc):
286+
async def test_recv_updates_read_handle_on_refresh(
287+
mock_client, mock_cls_async_bidi_rpc
288+
):
282289
"""
283290
Verify that the `recv` method correctly updates the stream's handle
284291
when a new one is provided in a server response.
@@ -289,11 +296,15 @@ async def test_recv_updates_read_handle_on_refresh(mock_client, mock_cls_async_b
289296
socket_like_rpc.open = AsyncMock()
290297

291298
initial_handle = _storage_v2.BidiReadHandle(handle=b"initial-handle-token")
292-
response_with_initial_handle = _storage_v2.BidiReadObjectResponse(read_handle=initial_handle)
299+
response_with_initial_handle = _storage_v2.BidiReadObjectResponse(
300+
read_handle=initial_handle
301+
)
293302
response_without_handle = _storage_v2.BidiReadObjectResponse(read_handle=None)
294303

295304
refreshed_handle = _storage_v2.BidiReadHandle(handle=b"new-refreshed-handle-token")
296-
response_with_refreshed_handle = _storage_v2.BidiReadObjectResponse(read_handle=refreshed_handle)
305+
response_with_refreshed_handle = _storage_v2.BidiReadObjectResponse(
306+
read_handle=refreshed_handle
307+
)
297308

298309
socket_like_rpc.recv.side_effect = [
299310
response_with_initial_handle,

0 commit comments

Comments
 (0)