@@ -270,3 +270,34 @@ def test_derivatives(tmp_path):
270
270
parser .parse_args (temp_args )
271
271
272
272
_reset_config ()
273
+
274
+
275
+ @pytest .mark .parametrize (
276
+ ('args' , 'expectation' ),
277
+ [
278
+ ([], 'auto' ),
279
+ (['--surface-recon-method' , 'auto' ], 'auto' ),
280
+ (['--surface-recon-method' , 'mcribs' ], 'mcribs' ),
281
+ (['--surface-recon-method' , 'infantfs' ], 'infantfs' ),
282
+ (['--surface-recon-method' , 'freesurfer' ], 'freesurfer' ),
283
+ (['--surface-recon-method' , 'none' ], None ),
284
+ (['--surface-recon-method' , 'None' ], None ),
285
+ (['--surface-recon-method' , 123 ], (TypeError ,)),
286
+ ],
287
+ )
288
+ def test_surface_recon_method (tmp_path , args , expectation ):
289
+ """Check the correct parsing of the memory argument."""
290
+ datapath = tmp_path / 'data'
291
+ datapath .mkdir (exist_ok = True )
292
+ _fs_file = tmp_path / 'license.txt'
293
+ _fs_file .write_text ('' )
294
+
295
+ args = [str (datapath )] + MIN_ARGS [1 :] + ['--fs-license-file' , str (_fs_file )] + args
296
+
297
+ cm = nullcontext ()
298
+ if isinstance (expectation , tuple ):
299
+ cm = pytest .raises (expectation )
300
+
301
+ with cm :
302
+ opts = _build_parser ().parse_args (args )
303
+ assert opts .surface_recon_method == expectation
0 commit comments