Skip to content

Commit b81cde8

Browse files
author
shariqiqbal2810
committed
Changed S3DataGrabber test to use openfmri bucket
One concern is that these files are large (we were using empty text files before), so the test is slowed considerably.
1 parent 9be1b7f commit b81cde8

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

nipype/interfaces/tests/test_io.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,31 +84,31 @@ def test_selectfiles_valueerror():
8484
yield assert_raises, ValueError, sf.run
8585

8686
def test_s3datagrabber_communication():
87-
dg = nio.S3DataGrabber(infields=['subj_id','run_num'], outfields=['func','struct'])
88-
dg.inputs.bucket = 'nipype-test'
89-
dg.inputs.bucket_path = 'data/'
87+
dg = nio.S3DataGrabber(infields=['subj_id', 'run_num'], outfields=['func', 'struct'])
88+
dg.inputs.bucket = 'openfmri'
89+
dg.inputs.bucket_path = 'ds001/'
9090
tempdir = mkdtemp()
9191
dg.inputs.local_directory = tempdir
9292
dg.inputs.sort_filelist = True
9393
dg.inputs.template = '*'
94-
dg.inputs.field_template = dict(func='%s/%s.txt',
95-
struct='%s/struct.txt')
96-
dg.inputs.subj_id = ['subj1','subj2']
97-
dg.inputs.run_num = ['run1', 'run2']
98-
dg.inputs.template_args = dict(func=[['subj_id','run_num']],
99-
struct=[['subj_id']])
94+
dg.inputs.field_template = dict(func='%s/BOLD/task001_%s/bold.nii.gz',
95+
struct='%s/anatomy/highres001_brain.nii.gz')
96+
dg.inputs.subj_id = ['sub001', 'sub002']
97+
dg.inputs.run_num = ['run001', 'run003']
98+
dg.inputs.template_args = dg.inputs.template_args = dict(
99+
func=[['subj_id', 'run_num']], struct=[['subj_id']])
100100
res = dg.run()
101101
func_outfiles = res.outputs.func
102102
struct_outfiles = res.outputs.struct
103103

104104
# check for all files
105-
yield assert_true, 'subj1/run1' in func_outfiles[0]
105+
yield assert_true, '/sub001/BOLD/task001_run001/bold.nii.gz' in func_outfiles[0]
106106
yield assert_true, os.path.exists(func_outfiles[0])
107-
yield assert_true, 'subj1/struct' in struct_outfiles[0]
107+
yield assert_true, '/sub001/anatomy/highres001_brain.nii.gz' in struct_outfiles[0]
108108
yield assert_true, os.path.exists(struct_outfiles[0])
109-
yield assert_true, 'subj2/run2' in func_outfiles[1]
109+
yield assert_true, '/sub002/BOLD/task001_run003/bold.nii.gz' in func_outfiles[1]
110110
yield assert_true, os.path.exists(func_outfiles[1])
111-
yield assert_true, 'subj2/struct' in struct_outfiles[1]
111+
yield assert_true, '/sub002/anatomy/highres001_brain.nii.gz' in struct_outfiles[1]
112112
yield assert_true, os.path.exists(struct_outfiles[1])
113113

114114
shutil.rmtree(tempdir)

0 commit comments

Comments
 (0)