Skip to content

Commit

Permalink
fix md5 test formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
BWMac committed Aug 30, 2024
1 parent 7b512b3 commit c8dc88e
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions tests/unit/synapseclient/core/unit_test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,13 @@ def init_syn(self, syn: Synapse) -> None:
self.syn = syn

async def test_md5_mismatch(self) -> None:
with (
patch("synapseclient.core.download.download_functions.download_file"),
patch.object(utils, "md5_for_file") as mock_md5_for_file,
patch.object(os, "remove") as mock_os_remove,
patch.object(shutil, "move") as mock_move,
):
with patch(
"synapseclient.core.download.download_functions.download_file"
), patch.object(utils, "md5_for_file") as mock_md5_for_file, patch.object(
os, "remove"
) as mock_os_remove, patch.object(
shutil, "move"
) as mock_move:
path = os.path.abspath("/myfakepath")

mock_md5_for_file.return_value.hexdigest.return_value = "unexpetedMd5"
Expand All @@ -597,16 +598,17 @@ async def test_md5_mismatch(self) -> None:
async def test_md5_match(self) -> None:
expected_md5 = "myExpectedMd5"

with (
patch("synapseclient.core.download.download_functions.download_file"),
patch.object(
utils,
"md5_for_file_hex",
return_value=expected_md5,
),
patch.object(os, "remove") as mock_os_remove,
patch.object(shutil, "move") as mock_move,
):
with patch(
"synapseclient.core.download.download_functions.download_file"
), patch.object(
utils,
"md5_for_file_hex",
return_value=expected_md5,
), patch.object(
os, "remove"
) as mock_os_remove, patch.object(
shutil, "move"
) as mock_move:
path = os.path.abspath("/myfakepath")

await download_from_url_multi_threaded(
Expand Down

0 comments on commit c8dc88e

Please sign in to comment.