Skip to content

Commit 1c9029a

Browse files
mgxdeffigies
authored andcommitted
tst: fix incorrect test behavior
1 parent 9285966 commit 1c9029a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

fmriprep/workflows/tests/test_base.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,25 @@ def test_get_estimator_b0field_and_intendedfor(tmp_path):
284284
)
285285

286286
assert get_estimator(layout, bold_files[0]) == ('epi',)
287+
# if B0FieldIdentifiers are found, IntendedFor will not be used
288+
assert get_estimator(layout, bold_files[1]) == ()
289+
290+
291+
def test_get_estimator_intendedfor(tmp_path):
292+
bids_dir = tmp_path / 'bids'
293+
294+
# Set B0FieldSource for run 1
295+
spec = deepcopy(BASE_LAYOUT)
296+
spec['01']['fmap'][0]['metadata']['IntendedFor'] = 'func/sub-01_task-rest_run-2_bold.nii.gz'
297+
298+
generate_bids_skeleton(bids_dir, spec)
299+
layout = bids.BIDSLayout(bids_dir)
300+
_ = find_estimators(layout=layout, subject='01')
301+
302+
bold_files = sorted(
303+
layout.get(suffix='bold', task='rest', extension='.nii.gz', return_type='file')
304+
)
305+
287306
assert get_estimator(layout, bold_files[1]) == ('auto_00000',)
288307

289308

0 commit comments

Comments
 (0)