File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
nipype/interfaces/freesurfer/tests Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -98,18 +98,23 @@ def test_mandatory_outvol(create_files_in_directory):
9898 with pytest .raises (ValueError ): mni .cmdline
9999
100100 # test with minimal args
101- mni .inputs .in_file = filelist [0 ]
102- assert mni .cmdline == ('mri_nu_correct.mni --i %s --o %s_output.mgz'
103- % (filelist [0 ], filelist [0 ].replace ('.mgz' , '' )))
101+ mni .inputs .in_file = filelist [0 ]
102+ base , ext = os .path .splitext (os .path .basename (filelist [0 ]))
103+ if ext == '.gz' :
104+ base , ext2 = os .path .splitext (base )
105+ ext = ext2 + ext
106+
107+ assert mni .cmdline == (
108+ 'mri_nu_correct.mni --i %s --o %s_output.%s' % (filelist [0 ], base , ext ))
104109
105110 # test with custom outfile
106111 mni .inputs .out_file = 'new_corrected_file.mgz'
107112 assert mni .cmdline == ('mri_nu_correct.mni --i %s --o new_corrected_file.mgz'
108113 % (filelist [0 ]))
109114
110115 # constructor based tests
111- mni2 = freesurfer .MNIBiasCorrection (in_file = filelist [0 ],
116+ mni2 = freesurfer .MNIBiasCorrection (in_file = filelist [0 ],
112117 out_file = 'bias_corrected_output' ,
113118 iterations = 4 )
114- assert mni2 .cmdline == ('mri_nu_correct.mni --i %s --n 4 --o bias_corrected_output.mgz '
115- % filelist [0 ])
119+ assert mni2 .cmdline == ('mri_nu_correct.mni --i %s --n 4 --o bias_corrected_output.%s '
120+ % ( filelist [0 ], ext ) )
You can’t perform that action at this time.
0 commit comments