Skip to content

Commit 84a755e

Browse files
committed
enh: add a test
1 parent 6b55a28 commit 84a755e

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

sdcflows/workflows/fit/tests/test_syn.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131

3232
@pytest.mark.veryslow
3333
@pytest.mark.slow
34-
@pytest.mark.parametrize("sd_prior", [True, False])
35-
def test_syn_wf(tmpdir, datadir, workdir, outdir, sloppy_mode, sd_prior):
34+
def test_syn_wf(tmpdir, datadir, workdir, outdir, sloppy_mode):
3635
"""Build and run an SDC-SyN workflow."""
3736
derivs_path = datadir / "ds000054" / "derivatives"
3837
smriprep = derivs_path / "smriprep-0.6" / "sub-100185" / "anat"
@@ -44,7 +43,6 @@ def test_syn_wf(tmpdir, datadir, workdir, outdir, sloppy_mode, sd_prior):
4443
debug=sloppy_mode,
4544
auto_bold_nss=True,
4645
t1w_inversion=True,
47-
sd_prior=sd_prior,
4846
)
4947
prep_wf.inputs.inputnode.in_epis = [
5048
str(
@@ -170,6 +168,24 @@ def test_syn_wf_inputs(sloppy, laplacian_weight):
170168
assert wf.inputs.syn.metric_weight == metric_weight
171169

172170

171+
@pytest.mark.parametrize("sd_prior", [True, False])
172+
def test_syn_preprocessing_wf_inputs(sd_prior):
173+
"""Test appropriate instantiation of the SDC-SyN preprocessing workflow."""
174+
175+
prep_wf = init_syn_preprocessing_wf(
176+
omp_nthreads=4,
177+
sd_prior=sd_prior,
178+
auto_bold_nss=True,
179+
t1w_inversion=True,
180+
)
181+
182+
if not sd_prior:
183+
with pytest.raises(AttributeError):
184+
prep_wf.inputs.prior_msk.in_file
185+
else:
186+
assert prep_wf.inputs.prior_msk.thresh_low
187+
188+
173189
@pytest.mark.parametrize("ants_version", ["2.2.0", "2.1.0", None])
174190
def test_syn_wf_version(monkeypatch, ants_version):
175191
"""Ensure errors are triggered with ANTs < 2.2."""

0 commit comments

Comments
 (0)