@@ -96,7 +96,8 @@ def test_selectfiles_valueerror():
96
96
97
97
@skipif (noboto )
98
98
def test_s3datagrabber_communication ():
99
- dg = nio .S3DataGrabber (infields = ['subj_id' , 'run_num' ], outfields = ['func' , 'struct' ])
99
+ dg = nio .S3DataGrabber (
100
+ infields = ['subj_id' , 'run_num' ], outfields = ['func' , 'struct' ])
100
101
dg .inputs .anon = True
101
102
dg .inputs .bucket = 'openfmri'
102
103
dg .inputs .bucket_path = 'ds001/'
@@ -108,20 +109,20 @@ def test_s3datagrabber_communication():
108
109
struct = '%s/anatomy/highres001_brain.nii.gz' )
109
110
dg .inputs .subj_id = ['sub001' , 'sub002' ]
110
111
dg .inputs .run_num = ['run001' , 'run003' ]
111
- dg .inputs .template_args = dg . inputs . template_args = dict (
112
+ dg .inputs .template_args = dict (
112
113
func = [['subj_id' , 'run_num' ]], struct = [['subj_id' ]])
113
114
res = dg .run ()
114
115
func_outfiles = res .outputs .func
115
116
struct_outfiles = res .outputs .struct
116
117
117
118
# check for all files
118
- yield assert_true , '/sub001/BOLD/task001_run001/bold.nii.gz' in func_outfiles [0 ]
119
+ yield assert_true , os . path . join ( dg . inputs . local_directory , '/sub001/BOLD/task001_run001/bold.nii.gz' ) in func_outfiles [0 ]
119
120
yield assert_true , os .path .exists (func_outfiles [0 ])
120
- yield assert_true , '/sub001/anatomy/highres001_brain.nii.gz' in struct_outfiles [0 ]
121
+ yield assert_true , os . path . join ( dg . inputs . local_directory , '/sub001/anatomy/highres001_brain.nii.gz' ) in struct_outfiles [0 ]
121
122
yield assert_true , os .path .exists (struct_outfiles [0 ])
122
- yield assert_true , '/sub002/BOLD/task001_run003/bold.nii.gz' in func_outfiles [1 ]
123
+ yield assert_true , os . path . join ( dg . inputs . local_directory , '/sub002/BOLD/task001_run003/bold.nii.gz' ) in func_outfiles [1 ]
123
124
yield assert_true , os .path .exists (func_outfiles [1 ])
124
- yield assert_true , '/sub002/anatomy/highres001_brain.nii.gz' in struct_outfiles [1 ]
125
+ yield assert_true , os . path . join ( dg . inputs . local_directory , '/sub002/anatomy/highres001_brain.nii.gz' ) in struct_outfiles [1 ]
125
126
yield assert_true , os .path .exists (struct_outfiles [1 ])
126
127
127
128
shutil .rmtree (tempdir )
@@ -220,7 +221,8 @@ def test_s3datasink_substitutions():
220
221
# run fakes3 server and set up bucket
221
222
fakes3dir = op .expanduser ('~/fakes3' )
222
223
try :
223
- proc = Popen (['fakes3' , '-r' , fakes3dir , '-p' , '4567' ], stdout = open (os .devnull , 'wb' ))
224
+ proc = Popen (
225
+ ['fakes3' , '-r' , fakes3dir , '-p' , '4567' ], stdout = open (os .devnull , 'wb' ))
224
226
except OSError as ose :
225
227
if 'No such file or directory' in str (ose ):
226
228
return # fakes3 not installed. OK!
0 commit comments