Skip to content

Commit

Permalink
Try out the new test function.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Oct 18, 2023
1 parent edb9daa commit db96b88
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions xcp_d/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ def test_ds001419_nifti(data_dir, output_dir, working_dir):
"200",
"--random-seed=8675309",
]
_run_and_generate(
_run_and_generate_2(
test_name=test_name,
participant_label="01",
parameters=parameters,
data_dir=data_dir,
out_dir=out_dir,
Expand Down Expand Up @@ -424,3 +423,24 @@ def _run_and_generate(
check_generated_files(out_dir, output_list_file)

check_affines(data_dir, out_dir, input_type=input_type)


def _run_and_generate_2(
test_name,
parameters,
data_dir,
out_dir,
input_type,
):
import sys
from unittest.mock import patch

from xcp_d.cli.run import main

with patch.object(sys, "argv", parameters):
main()

output_list_file = os.path.join(get_test_data_path(), f"{test_name}_outputs.txt")
check_generated_files(out_dir, output_list_file)

check_affines(data_dir, out_dir, input_type=input_type)

0 comments on commit db96b88

Please sign in to comment.