def test_eddy_correct2(): filelist, outdir, cwd = create_files_in_directory() eddy = fsl.EddyCorrect() # make sure command gets called yield assert_equal, eddy.cmd, 'eddy_correct' # test raising error with mandatory args absent yield assert_raises, ValueError, eddy.run # .inputs based parameters setting eddy.inputs.in_file = filelist[0] eddy.inputs.out_file = 'foo_eddc.nii' eddy.inputs.ref_num = 100 yield assert_equal, eddy.cmdline, 'eddy_correct %s foo_eddc.nii 100' % filelist[ 0] # .run based parameter setting eddy2 = fsl.EddyCorrect(in_file=filelist[0], out_file='foo_ec.nii', ref_num=20) yield assert_equal, eddy2.cmdline, 'eddy_correct %s foo_ec.nii 20' % filelist[ 0] # test arguments for opt_map # eddy_correct class doesn't have opt_map{} clean_directory(outdir, cwd)
def test_eddy_correct2(create_files_in_directory): filelist, outdir = create_files_in_directory eddy = fsl.EddyCorrect() # make sure command gets called assert eddy.cmd == 'eddy_correct' # test raising error with mandatory args absent with pytest.raises(ValueError): eddy.run() # .inputs based parameters setting eddy.inputs.in_file = filelist[0] eddy.inputs.out_file = 'foo_eddc.nii' eddy.inputs.ref_num = 100 assert eddy.cmdline == 'eddy_correct %s foo_eddc.nii 100' % filelist[0] # .run based parameter setting eddy2 = fsl.EddyCorrect( in_file=filelist[0], out_file='foo_ec.nii', ref_num=20) assert eddy2.cmdline == 'eddy_correct %s foo_ec.nii 20' % filelist[0]