@@ -126,7 +126,7 @@ def test_b0dwi_for_fmap(tmpdir, capfd):
126
126
)
127
127
# Two possibilities: with or without heuristics:
128
128
@pytest .mark .parametrize (
129
- "heuristic" , ['example' , None ] # heuristics/example.py
129
+ "heuristic" , ['example' , 'reproin' , None ] # heuristics/example.py, heuristics/reproin .py
130
130
)
131
131
def test_populate_intended_for (tmpdir , monkeypatch , capfd ,
132
132
subjects , sesID , expected_session_folder ,
@@ -163,7 +163,7 @@ def mock_populate_intended_for(session, matching_parameter='Shims', criterion='C
163
163
for s in subjects
164
164
]
165
165
166
- heuristic = load_heuristic ('example' ) if heuristic else None
166
+ heuristic = load_heuristic (heuristic ) if heuristic else None
167
167
heudiconv .convert .convert (items ,
168
168
converter = '' ,
169
169
scaninfo_suffix = '.json' ,
@@ -175,12 +175,14 @@ def mock_populate_intended_for(session, matching_parameter='Shims', criterion='C
175
175
min_meta = True ,
176
176
overwrite = False )
177
177
output = capfd .readouterr ()
178
- if heuristic :
178
+ # if the heuristic module has a 'POPULATE_INTENDED_FOR_OPTS' field, we expect
179
+ # to get the output of the mock_populate_intended_for, otherwise, no output:
180
+ if getattr (heuristic , 'POPULATE_INTENDED_FOR_OPTS' , None ):
179
181
assert all ([
180
182
"\n " .join ([
181
183
"session: " + outfolder .format (sID = s , ses = sesID ),
182
184
# "ImagingVolume" is defined in heuristic file; "Shims" is the default
183
- "matching_parameter: " + ( "ImagingVolume" if heuristic else "Shims" ) ,
185
+ "matching_parameter: " + "ImagingVolume" ,
184
186
"criterion: Closest"
185
187
]) in output .out
186
188
for s in subjects
0 commit comments