@@ -324,6 +324,12 @@ def test_mcflirt(setup_flirt):
324
324
realcmd = 'mcflirt -in ' + infile + ' -out ' + outfile2
325
325
assert frt .cmdline == realcmd
326
326
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
+
327
333
opt_map = {
328
334
'cost' : ('-cost mutualinfo' , 'mutualinfo' ),
329
335
'bins' : ('-bins 256' , 256 ),
@@ -344,6 +350,9 @@ def test_mcflirt(setup_flirt):
344
350
345
351
for name , settings in list (opt_map .items ()):
346
352
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
+
347
356
instr = '-in %s' % (infile )
348
357
outstr = '-out %s' % (outfile )
349
358
if name in ('init' , 'cost' , 'dof' , 'mean_vol' , 'bins' ):
@@ -357,10 +366,14 @@ def test_mcflirt(setup_flirt):
357
366
outstr ,
358
367
settings [0 ]])
359
368
369
+
370
+ @pytest .mark .skipif (no_fsl (), reason = "fsl is not installed" )
371
+ def test_mcflirt_noinput ():
360
372
# Test error is raised when missing required args
361
373
fnt = fsl .MCFLIRT ()
362
- with pytest .raises (ValueError ):
374
+ with pytest .raises (ValueError ) as excinfo :
363
375
fnt .run ()
376
+ assert str (excinfo .value ).startswith ("MCFLIRT requires a value for input 'in_file'" )
364
377
365
378
# test fnirt
366
379
0 commit comments