Skip to content

Commit 214d66c

Browse files
committed
test that precalculated boldrefs are found
1 parent 29ad1c2 commit 214d66c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
5+
from fmriprep.utils import bids
6+
7+
8+
@pytest.mark.parametrize('desc', ['hmc', 'coreg'])
9+
def test_baseline_found_as_str(tmp_path: Path, desc: str):
10+
subject = '0'
11+
task = 'rest'
12+
13+
to_find = tmp_path.joinpath(
14+
f'sub-{subject}', 'func', f'sub-{subject}_task-{task}_desc-{desc}_boldref.nii.gz'
15+
)
16+
to_find.parent.mkdir(parents=True)
17+
to_find.touch()
18+
19+
entities = {
20+
'subject': subject,
21+
'task': task,
22+
'suffix': 'bold',
23+
'extension': '.nii.gz',
24+
}
25+
26+
derivs = bids.collect_derivatives(derivatives_dir=tmp_path, entities=entities)
27+
assert dict(derivs) == {f'{desc}_boldref': str(to_find)}

0 commit comments

Comments
 (0)