File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change
1
+ import pytest
2
+ import shutil
3
+ from pkg_resources import resource_filename
4
+
5
+ from nipype .interfaces import fsl
6
+ from pydra .tasks .nipype1 .utils import Nipype1Task
7
+
8
+
9
+ @pytest .mark .skipif (fsl .Info .version () is None , reason = "Test requires FSL" )
10
+ def test_isolation (tmp_path ):
11
+ in_file = tmp_path / "orig/tpms_msk.nii.gz"
12
+ in_file .parent .mkdir ()
13
+ shutil .copyfile (resource_filename ("nipype" , "testing/data/tpms_msk.nii.gz" ), in_file )
14
+
15
+ out_dir = tmp_path / "output"
16
+ out_dir .mkdir ()
17
+
18
+ slicer = Nipype1Task (fsl .Slice (), cache_dir = str (out_dir ))
19
+ slicer .inputs .in_file = in_file
20
+
21
+ res = slicer ()
22
+ assert res .output .out_files
23
+ assert all (fname .startswith (str (out_dir )) for fname in res .output .out_files )
Original file line number Diff line number Diff line change @@ -68,5 +68,7 @@ def __init__(
68
68
69
69
def _run_task (self ):
70
70
inputs = attr .asdict (self .inputs , filter = lambda a , v : v is not attr .NOTHING )
71
- res = self ._interface .run (** inputs )
71
+ node = nipype .Node (self ._interface , base_dir = self .output_dir , name = self .name )
72
+ node .inputs .trait_set (** inputs )
73
+ res = node .run ()
72
74
self .output_ = res .outputs .get ()
You can’t perform that action at this time.
0 commit comments