Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nipype/interfaces/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ def _list_outputs(self):


class FSSourceInputSpec(BaseInterfaceInputSpec):
subjects_dir = Directory(mandatory=True,
subjects_dir = Directory(exists=True, mandatory=True,
desc='Freesurfer subjects directory.')
subject_id = Str(mandatory=True,
desc='Subject name for whom to retrieve data')
Expand Down
7 changes: 7 additions & 0 deletions nipype/interfaces/tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,13 @@ def test_freesurfersource():
assert fss.inputs.subjects_dir == Undefined


def test_freesurfersource_incorrectdir():
fss = nio.FreeSurferSource()
with pytest.raises(Exception) as err:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't it work using with pytest.raises(TraitError) ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, after importing TraitError it works...

fss.inputs.subjects_dir = 'path/to/no/existing/directory'
assert "TraitError" == err.typename


def test_jsonsink_input():

ds = nio.JSONFileSink()
Expand Down