8
8
9
9
from nose .tools import assert_raises
10
10
import nipype
11
- from nipype .testing import assert_equal , assert_true , assert_false
11
+ from nipype .testing import assert_equal , assert_true , assert_false , skipif
12
12
import nipype .interfaces .io as nio
13
13
from nipype .interfaces .base import Undefined
14
14
15
+ noboto = False
15
16
try :
16
17
import boto3
17
18
except :
19
+ noboto = True
18
20
pass
19
21
20
22
@@ -24,6 +26,7 @@ def test_datagrabber():
24
26
yield assert_equal , dg .inputs .base_directory , Undefined
25
27
yield assert_equal , dg .inputs .template_args , {'outfiles' : []}
26
28
29
+ @skipif (noboto )
27
30
def test_s3datagrabber ():
28
31
dg = nio .S3DataGrabber ()
29
32
yield assert_equal , dg .inputs .template , Undefined
@@ -83,6 +86,7 @@ def test_selectfiles_valueerror():
83
86
force_lists = force_lists )
84
87
yield assert_raises , ValueError , sf .run
85
88
89
+ @skipif (noboto )
86
90
def test_s3datagrabber_communication ():
87
91
dg = nio .S3DataGrabber (infields = ['subj_id' , 'run_num' ], outfields = ['func' , 'struct' ])
88
92
dg .inputs .bucket = 'openfmri'
@@ -113,7 +117,6 @@ def test_s3datagrabber_communication():
113
117
114
118
shutil .rmtree (tempdir )
115
119
116
-
117
120
def test_datagrabber_order ():
118
121
tempdir = mkdtemp ()
119
122
file1 = mkstemp (prefix = 'sub002_L1_R1.q' , dir = tempdir )
@@ -150,6 +153,7 @@ def test_datasink():
150
153
ds = nio .DataSink (infields = ['test' ])
151
154
yield assert_true , 'test' in ds .inputs .copyable_trait_names ()
152
155
156
+ @skipif (noboto )
153
157
def test_s3datasink ():
154
158
ds = nio .S3DataSink ()
155
159
yield assert_true , ds .inputs .parameterization
@@ -190,6 +194,7 @@ def test_datasink_substitutions():
190
194
shutil .rmtree (indir )
191
195
shutil .rmtree (outdir )
192
196
197
+ @skipif (noboto )
193
198
def test_s3datasink_substitutions ():
194
199
indir = mkdtemp (prefix = '-Tmp-nipype_ds_subs_in' )
195
200
outdir = mkdtemp (prefix = '-Tmp-nipype_ds_subs_out' )
0 commit comments