Skip to content

Commit 4401bb8

Browse files
author
Shoshana Berleant
committed
set up 2 out of 3 inputs for compcor node
1 parent 08bccfa commit 4401bb8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

nipype/workflows/rsfmri/fsl/tests/test_resting.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@
1515
import numpy as np
1616
import os
1717

18+
19+
20+
21+
1822
def mock_node_factory(*args, **kwargs):
1923
''' return mocks for all the nodes except compcor and compcor's neighbors'''
2024
mock = MagicMock()
25+
if 'interface' in kwargs.keys():
26+
mock = mock.create_autospec(kwargs['interface'], instance=True)
2127
if 'name' in kwargs.keys():
2228
name = kwargs['name']
2329
if name == 'compcor':
@@ -28,21 +34,20 @@ def mock_node_factory(*args, **kwargs):
2834
return Node(IdentityInterface(fields=['out_file', 'lowpass_sigma',
2935
'num_noise_components',
3036
'func', 'highpass_sigma']),
31-
name='fake'+name)
37+
name=name)
3238
if name in ('remove_noise'):
3339
# node that takes output from compcor
3440
return Node(IdentityInterface(fields=['design_file', 'out_file']),
3541
name=name)
3642
mock.name = kwargs['name']
37-
if 'interface' in kwargs.keys():
38-
mock = mock.create_autospec(kwargs['interface'], instance=True)
3943
mock.iterables = None
4044
return mock
4145

4246
class TestResting(unittest.TestCase):
4347

4448
in_filenames = {
4549
'in_file': 'rsfmrifunc.nii',
50+
'noise_mask_file': 'rsfmrimask.nii'
4651
}
4752

4853
out_filenames = {
@@ -64,6 +69,8 @@ def test_create_resting_preproc(self, mock_Node, mock_realign_wf, nothing):
6469
# setup
6570
# run
6671
wf = create_resting_preproc()
72+
wf.inputs.inputspec.num_noise_components = 6
73+
wf.get_node('threshold').inputs.out_file = self.in_filenames['noise_mask_file']
6774
wf.run()
6875

6976
# assert

0 commit comments

Comments
 (0)