Skip to content

Commit d6894b4

Browse files
author
Shoshana Berleant
committed
test
1 parent 38f925a commit d6894b4

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

nipype/interfaces/fsl/tests/test_preprocess.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,30 @@ def test_fast():
167167
"-S 1 %s" % tmp_infile])
168168
teardown_infile(tmp_dir)
169169

170+
@skipif(no_fsl)
171+
def test_fast_list_outputs():
172+
''' By default (no -o), FSL's fast command outputs files into the same
173+
directory as the input files. If the flag -o is set, it outputs files into
174+
the cwd '''
175+
def _run_and_test(opts, output_base):
176+
outputs = fsl.FAST(**opts)._list_outputs()
177+
assert_equal(output_base, outputs['tissue_class_map'][:len(output_base)])
178+
assert_true(False)
179+
180+
# set up
181+
infile, indir = setup_infile()
182+
cwd = tempfile.mkdtemp()
183+
os.chdir(cwd)
184+
yield assert_not_equal, indir, cwd
185+
out_basename = 'a_basename.nii.gz'
186+
187+
# run and test
188+
opts = {'in_files': tmp_infile}
189+
input_path, input_filename, input_ext = split_filename(tmp_infile)
190+
_run_and_test(opts, os.path.join(input_path, input_filename))
191+
192+
opts['out_basename'] = out_basename
193+
_run_and_test(opts, os.path.join(cwd, out_basename))
170194

171195
@skipif(no_fsl)
172196
def setup_flirt():

0 commit comments

Comments
 (0)