Skip to content

Commit c29e250

Browse files
committed
Small fixes after rebase.
1 parent 679f3b8 commit c29e250

5 files changed

Lines changed: 6 additions & 74 deletions

File tree

tests/tests_integration/base.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import os
2-
import platform
31
import subprocess
4-
import subprocess
5-
62
import warnings
73

84
import pytest
@@ -90,6 +86,4 @@ def setup_ssh_container(self):
9086
ssh_test_utils.setup_ssh_container(container_name)
9187
yield
9288

93-
sudo = "sudo " if platform.system() == "Linux" else ""
94-
95-
subprocess.run(f"{sudo}docker rm -f {container_name}", shell=True)
89+
subprocess.run(f"docker rm -f {container_name}", shell=True)

tests/tests_integration/base_transfer.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
"""
1+
""" """
32

43
import copy
54
from pathlib import Path
@@ -30,7 +29,7 @@ def pathtable_and_project(self, tmpdir_factory):
3029
base_path = tmp_path / "test with space"
3130
test_project_name = "test_file_conflicts"
3231

33-
project, cwd = test_utils.setup_project_fixture(
32+
project = test_utils.setup_project_fixture(
3433
base_path, test_project_name
3534
)
3635

@@ -40,7 +39,7 @@ def pathtable_and_project(self, tmpdir_factory):
4039

4140
yield [pathtable, project]
4241

43-
test_utils.teardown_project(cwd, project)
42+
test_utils.teardown_project(project)
4443

4544
def get_expected_transferred_paths(
4645
self, pathtable, sub_names, ses_names, datatype

tests/tests_integration/test_ssh_setup.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,8 @@ def project(test, tmp_path, setup_ssh_container):
2626

2727
project = test_utils.setup_project_fixture(tmp_path, test_project_name)
2828

29-
# ssh_test_utils.setup_project_and_container_for_ssh(project)
30-
3129
ssh_test_utils.setup_project_for_ssh(
3230
project,
33-
central_path=f"/home/sshuser/datashuttle/{project.project_name}",
34-
central_host_id="localhost",
35-
central_host_username="sshuser",
3631
)
3732

3833
yield project

tests/tests_integration/test_ssh_transfer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def ssh_setup(self, pathtable_and_project, setup_ssh_container):
3737
# Test Setup SSH Connection
3838
# -----------------------------------------------------------------
3939

40-
@pytest.mark.skipif("not TEST_SSH", reason="TEST_SSH is false")
4140
@pytest.mark.parametrize(
4241
"sub_names", [["all"], ["all_non_sub", "sub-002"]]
4342
)

tests/tests_integration/test_transfer_special_arguments.py

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
["all_sub"],
1616
["all_non_sub"],
1717
["sub-001"],
18-
["sub-003_date-20231901"],
18+
["sub-003_date-20231201"],
1919
["sub-002", "all_non_sub"],
2020
]
2121
PARAM_SES = [
@@ -37,63 +37,8 @@
3737
["anat", "behav", "all_non_datatype"],
3838
]
3939

40-
class TestFileTransfer:
41-
@pytest.fixture(
42-
scope="class",
43-
)
44-
def pathtable_and_project(self, tmpdir_factory):
45-
"""
46-
Create a new test project with a test project folder
47-
and file structure (see `get_pathtable()` for definition).
48-
"""
49-
tmp_path = tmpdir_factory.mktemp("test")
50-
51-
base_path = tmp_path / "test with space"
52-
test_project_name = "test_file_conflicts"
53-
54-
project = test_utils.setup_project_fixture(
55-
base_path, test_project_name
56-
)
57-
58-
if testing_ssh:
59-
ssh_test_utils.setup_project_for_ssh(
60-
project,
61-
test_utils.make_test_path(
62-
central_path, "central", test_project_name
63-
),
64-
ssh_config.CENTRAL_HOST_ID,
65-
ssh_config.USERNAME,
66-
)
67-
68-
# Initialise the SSH connection
69-
ssh_test_utils.build_docker_image(project)
70-
71-
ssh_test_utils.setup_hostkeys(project)
72-
73-
pathtable = get_pathtable(project.cfg["local_path"])
74-
75-
self.create_all_pathtable_files(pathtable)
76-
77-
yield [pathtable, project]
78-
79-
test_utils.teardown_project(project)
80-
81-
@pytest.fixture(
82-
scope="class",
83-
)
84-
def ssh_setup(self, pathtable_and_project):
85-
"""
86-
After initial project setup (in `pathtable_and_project`)
87-
setup a container and the project's SSH connection to the container.
88-
Then upload the test project to the `central_path`.
89-
"""
90-
pathtable, project = pathtable_and_project
91-
ssh_test_utils.setup_project_and_container_for_ssh(project)
92-
ssh_test_utils.setup_ssh_connection(project)
93-
94-
project.upload_rawdata()
9540

96-
return [pathtable, project]
41+
class TestFileTransfer(BaseTransfer):
9742

9843
# ----------------------------------------------------------------------------------
9944
# Test File Transfer - All Options

0 commit comments

Comments
 (0)