Skip to content

Commit

Permalink
[TEST] B3O
Browse files Browse the repository at this point in the history
  • Loading branch information
bclenet committed Apr 18, 2024
1 parent 00c2e4d commit d42b42f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 38 deletions.
39 changes: 3 additions & 36 deletions tests/pipelines/test_team_B23O.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,48 +90,15 @@ def test_subject_information():

@staticmethod
@mark.unit_test
def test_confounds_file_no_outliers(temporary_data_dir):
""" Test the get_confounds_file method in the case with no outliers """
def test_confounds_file(temporary_data_dir):
""" Test the get_confounds_file method """

# Get input and reference output file
confounds_file = join(
Configuration()['directories']['test_data'], 'pipelines', 'confounds.tsv')
reference_file = join(
Configuration()['directories']['test_data'],
'pipelines', 'team_B23O', 'out_confounds_no_outliers.tsv')

# Create new confounds file
confounds_node = Node(Function(
input_names = ['filepath', 'subject_id', 'run_id'],
output_names = ['confounds_file'],
function = PipelineTeamB23O.get_confounds_file),
name = 'confounds_node')
confounds_node.base_dir = temporary_data_dir
confounds_node.inputs.filepath = confounds_file
confounds_node.inputs.subject_id = 'sid'
confounds_node.inputs.run_id = 'rid'
confounds_node.run()

# Check confounds file was created
created_confounds_file = abspath(join(
temporary_data_dir, confounds_node.name, 'confounds_file_sub-sid_run-rid.tsv'))
assert exists(created_confounds_file)

# Check contents
assert cmp(reference_file, created_confounds_file)

@staticmethod
@mark.unit_test
def test_confounds_file_outliers(temporary_data_dir):
""" Test the get_confounds_file method in the case with outliers """

# Get input and reference output file
confounds_file = join(
Configuration()['directories']['test_data'],
'pipelines', 'team_B23O', 'confounds_with_outliers.tsv')
reference_file = join(
Configuration()['directories']['test_data'],
'pipelines', 'team_B23O', 'out_confounds_outliers.tsv')
'pipelines', 'team_B23O', 'confounds.tsv')

# Create new confounds file
confounds_node = Node(Function(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_data/pipelines/team_B23O/confounds.tsv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
6551.281999999999 6476.4653 9874.576 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 -0.0 0.0
6484.7285 6473.4890000000005 9830.212 0.0263099209 -0.0673065879 0.0934882554 -0.0079328884 0.0338007737 -0.011491083999999999 -0.042411347099999996 0.027736422900000002 0.0453303087 -0.07022609490000001 0.0963618709 -0.0200867957 0.0665186088 0.0665174038 0.0665153954 0.0665125838 0.0665089688 0.06650455059999999 0.0 -0.00996895 -0.0313444 -3.00931e-06 0.00132687 -0.000384193 -0.00016819
6441.5337 6485.7256 9821.212 -0.0404820317 0.034150583 0.13661184210000002 0.0745358691 -0.0054829985999999995 -0.0217322686 0.046214115199999996 0.005774624 -0.043909359800000006 -0.075619539 0.17546891539999998 -0.0345256763 0.0665153954 0.06650455059999999 0.06648647719999999 0.0664611772 0.0664286533 0.0663889091 0.0 -2.56954e-05 -0.00923735 0.0549667 0.000997278 -0.00019745 -0.000398988
6484.7285 6473.4890000000005 9830.212 0.0263099209 -0.0673065879 0.0934882554 -0.0079328884 0.0338007737 -0.0114910839999999 -0.0424113470999999 0.0277364229 0.0453303087 -0.0702260949 0.0963618709 -0.0200867957 0.0665186088 0.0665174038 0.0665153954 0.0665125838 0.0665089688 0.0665045505999999 0.0 -0.00996895 -0.0313444 -3.00931e-06 0.00132687 -0.000384193 -0.00016819
6441.5337 6485.7256 9821.212 -0.0404820317 0.034150583 0.1366118421 0.0745358691 -0.0054829985999999 -0.0217322686 0.0462141151999999 0.005774624 -0.0439093598 -0.075619539 0.1754689153999999 -0.0345256763 0.0665153954 0.0665045505999999 0.0664864771999999 0.0664611772 0.0664286533 0.0663889091 0.0 -2.56954e-05 -0.00923735 0.0549667 0.000997278 -0.00019745 -0.000398988

0 comments on commit d42b42f

Please sign in to comment.