Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
BWMac committed Aug 30, 2024
1 parent 7d417b3 commit f229298
Showing 1 changed file with 38 additions and 40 deletions.
78 changes: 38 additions & 40 deletions tests/unit/synapseclient/core/unit_test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,12 @@ async def test_mock_download(syn: Synapse) -> None:
},
}

with (
patch.object(syn._requests_session, "get", side_effect=mock_requests_get),
patch.object(syn, "_generate_headers", side_effect=mock_generate_headers),
patch(
GET_FILE_HANDLE_FOR_DOWNLOAD,
new_callable=AsyncMock,
return_value=_getFileHandleDownload_return_value,
),
with patch.object(
syn._requests_session, "get", side_effect=mock_requests_get
), patch.object(syn, "_generate_headers", side_effect=mock_generate_headers), patch(
GET_FILE_HANDLE_FOR_DOWNLOAD,
new_callable=AsyncMock,
return_value=_getFileHandleDownload_return_value,
):
await download_by_file_handle(
file_handle_id=FILE_HANDLE_ID,
Expand Down Expand Up @@ -281,14 +279,14 @@ async def test_mock_download(syn: Synapse) -> None:
# with patch.object(
# syn, "rest_get_async", new_callable=AsyncMock, side_effect=mock_requests_get
# )
with (
patch.object(syn._requests_session, "get", side_effect=mock_requests_get),
patch.object(Synapse, "_generate_headers", side_effect=mock_generate_headers),
patch(
GET_FILE_HANDLE_FOR_DOWNLOAD,
new_callable=AsyncMock,
return_value=_getFileHandleDownload_return_value,
),
with patch.object(
syn._requests_session, "get", side_effect=mock_requests_get
), patch.object(
Synapse, "_generate_headers", side_effect=mock_generate_headers
), patch(
GET_FILE_HANDLE_FOR_DOWNLOAD,
new_callable=AsyncMock,
return_value=_getFileHandleDownload_return_value,
):
await download_by_file_handle(
file_handle_id=FILE_HANDLE_ID,
Expand Down Expand Up @@ -332,14 +330,14 @@ async def test_mock_download(syn: Synapse) -> None:
# with patch.object(
# syn, "rest_get_async", new_callable=AsyncMock, side_effect=mock_requests_get
# )
with (
patch.object(syn._requests_session, "get", side_effect=mock_requests_get),
patch.object(Synapse, "_generate_headers", side_effect=mock_generate_headers),
patch(
GET_FILE_HANDLE_FOR_DOWNLOAD,
new_callable=AsyncMock,
return_value=_getFileHandleDownload_return_value,
),
with patch.object(
syn._requests_session, "get", side_effect=mock_requests_get
), patch.object(
Synapse, "_generate_headers", side_effect=mock_generate_headers
), patch(
GET_FILE_HANDLE_FOR_DOWNLOAD,
new_callable=AsyncMock,
return_value=_getFileHandleDownload_return_value,
):
with pytest.raises(Exception):
await download_by_file_handle(
Expand Down Expand Up @@ -374,14 +372,14 @@ async def test_mock_download(syn: Synapse) -> None:
# with patch.object(
# syn, "rest_get_async", new_callable=AsyncMock, side_effect=mock_requests_get
# )
with (
patch.object(syn._requests_session, "get", side_effect=mock_requests_get),
patch.object(Synapse, "_generate_headers", side_effect=mock_generate_headers),
patch(
GET_FILE_HANDLE_FOR_DOWNLOAD,
new_callable=AsyncMock,
return_value=_getFileHandleDownload_return_value,
),
with patch.object(
syn._requests_session, "get", side_effect=mock_requests_get
), patch.object(
Synapse, "_generate_headers", side_effect=mock_generate_headers
), patch(
GET_FILE_HANDLE_FOR_DOWNLOAD,
new_callable=AsyncMock,
return_value=_getFileHandleDownload_return_value,
):
await download_by_file_handle(
file_handle_id=FILE_HANDLE_ID,
Expand All @@ -405,14 +403,14 @@ async def test_mock_download(syn: Synapse) -> None:
# with patch.object(
# syn, "rest_get_async", new_callable=AsyncMock, side_effect=mock_requests_get
# )
with (
patch.object(syn._requests_session, "get", side_effect=mock_requests_get),
patch.object(Synapse, "_generate_headers", side_effect=mock_generate_headers),
patch(
GET_FILE_HANDLE_FOR_DOWNLOAD,
new_callable=AsyncMock,
return_value=_getFileHandleDownload_return_value,
),
with patch.object(
syn._requests_session, "get", side_effect=mock_requests_get
), patch.object(
Synapse, "_generate_headers", side_effect=mock_generate_headers
), patch(
GET_FILE_HANDLE_FOR_DOWNLOAD,
new_callable=AsyncMock,
return_value=_getFileHandleDownload_return_value,
):
with pytest.raises(SynapseHTTPError):
await download_by_file_handle(
Expand Down

0 comments on commit f229298

Please sign in to comment.