Skip to content

Commit

Permalink
test that precalculated boldrefs are found
Browse files Browse the repository at this point in the history
  • Loading branch information
psadil committed Oct 2, 2024
1 parent 29ad1c2 commit 214d66c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions fmriprep/utils/tests/test_derivative_cache.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from pathlib import Path

import pytest

from fmriprep.utils import bids


@pytest.mark.parametrize('desc', ['hmc', 'coreg'])
def test_baseline_found_as_str(tmp_path: Path, desc: str):
subject = '0'
task = 'rest'

to_find = tmp_path.joinpath(
f'sub-{subject}', 'func', f'sub-{subject}_task-{task}_desc-{desc}_boldref.nii.gz'
)
to_find.parent.mkdir(parents=True)
to_find.touch()

entities = {
'subject': subject,
'task': task,
'suffix': 'bold',
'extension': '.nii.gz',
}

derivs = bids.collect_derivatives(derivatives_dir=tmp_path, entities=entities)
assert dict(derivs) == {f'{desc}_boldref': str(to_find)}

0 comments on commit 214d66c

Please sign in to comment.