Skip to content

Commit

Permalink
Fix bad refactor on .
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeZiminski committed Apr 10, 2024
1 parent dce8796 commit 3096396
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions tests/tests_integration/test_filesystem_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ def test_empty_folder_is_not_transferred(self, project):
).is_dir()

@pytest.mark.parametrize(
"top_level_folder",
"top_level_folder_to_transfer",
canonical_folders.get_top_level_folders(),
)
@pytest.mark.parametrize("upload_or_download", ["upload", "download"])
@pytest.mark.parametrize("transfer_method", ["top_level_folder", "custom"])
def test_transfer_across_top_level_folders(
self,
project,
top_level_folder,
top_level_folder_to_transfer, # Do not change this name, see doc
upload_or_download,
transfer_method,
):
Expand All @@ -83,6 +83,10 @@ def test_transfer_across_top_level_folders(
then transfer using upload / download and
upload_rawdata() / download_rawdata() that only the working top-level folder
is transferred.
Do not change the name of variable `top_level_folder_to_transfer`.
It is very tempting to change it to `top_level_folder`. In this test
they are not the same thing!
"""
subs, sessions = test_utils.get_default_sub_sessions_to_test()

Expand All @@ -99,18 +103,25 @@ def test_transfer_across_top_level_folders(
transfer_function,
base_path_to_check,
) = test_utils.handle_upload_or_download(
project, upload_or_download, transfer_method, top_level_folder
project,
upload_or_download,
transfer_method,
top_level_folder_to_transfer,
)

if transfer_method == "custom":
transfer_function(top_level_folder, "all", "all", "all")
transfer_function(
top_level_folder_to_transfer, "all", "all", "all"
)
else:
transfer_function()

full_base_path_to_check = base_path_to_check / top_level_folder
full_base_path_to_check = (
base_path_to_check / top_level_folder_to_transfer
)

test_utils.check_working_top_level_folder_only_exists(
top_level_folder,
top_level_folder_to_transfer,
full_base_path_to_check,
subs,
sessions,
Expand Down

0 comments on commit 3096396

Please sign in to comment.