Skip to content

Commit 7b3d98c

Browse files
committed
adding exists=True for subjects_dir in FSSourceInputSpec
1 parent 373bddd commit 7b3d98c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

nipype/interfaces/io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ def _list_outputs(self):
14851485

14861486

14871487
class FSSourceInputSpec(BaseInterfaceInputSpec):
1488-
subjects_dir = Directory(mandatory=True,
1488+
subjects_dir = Directory(exists=True, mandatory=True,
14891489
desc='Freesurfer subjects directory.')
14901490
subject_id = Str(mandatory=True,
14911491
desc='Subject name for whom to retrieve data')

nipype/interfaces/tests/test_io.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,13 @@ def test_freesurfersource():
407407
assert fss.inputs.subjects_dir == Undefined
408408

409409

410+
def test_freesurfersource_incorrectdir():
411+
fss = nio.FreeSurferSource()
412+
with pytest.raises(Exception) as err:
413+
fss.inputs.subjects_dir = 'path/to/no/existing/directory'
414+
assert "TraitError" == err.typename
415+
416+
410417
def test_jsonsink_input():
411418

412419
ds = nio.JSONFileSink()

0 commit comments

Comments
 (0)