We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29ad1c2 commit 214d66cCopy full SHA for 214d66c
fmriprep/utils/tests/test_derivative_cache.py
@@ -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