@@ -324,6 +324,12 @@ def test_mcflirt(setup_flirt):
324324 realcmd = 'mcflirt -in ' + infile + ' -out ' + outfile2
325325 assert frt .cmdline == realcmd
326326
327+
328+ @pytest .mark .skipif (no_fsl (), reason = "fsl is not installed" )
329+ def test_mcflirt_opt (setup_flirt ):
330+ tmpdir , infile , reffile = setup_flirt
331+ _ , nme = os .path .split (infile )
332+
327333 opt_map = {
328334 'cost' : ('-cost mutualinfo' , 'mutualinfo' ),
329335 'bins' : ('-bins 256' , 256 ),
@@ -344,6 +350,9 @@ def test_mcflirt(setup_flirt):
344350
345351 for name , settings in list (opt_map .items ()):
346352 fnt = fsl .MCFLIRT (in_file = infile , ** {name : settings [1 ]})
353+ outfile = os .path .join (os .getcwd (), nme )
354+ outfile = fnt ._gen_fname (outfile , suffix = '_mcf' )
355+
347356 instr = '-in %s' % (infile )
348357 outstr = '-out %s' % (outfile )
349358 if name in ('init' , 'cost' , 'dof' , 'mean_vol' , 'bins' ):
@@ -357,10 +366,14 @@ def test_mcflirt(setup_flirt):
357366 outstr ,
358367 settings [0 ]])
359368
369+
370+ @pytest .mark .skipif (no_fsl (), reason = "fsl is not installed" )
371+ def test_mcflirt_noinput ():
360372 # Test error is raised when missing required args
361373 fnt = fsl .MCFLIRT ()
362- with pytest .raises (ValueError ):
374+ with pytest .raises (ValueError ) as excinfo :
363375 fnt .run ()
376+ assert str (excinfo .value ).startswith ("MCFLIRT requires a value for input 'in_file'" )
364377
365378# test fnirt
366379
0 commit comments