code: def test_bet(setup_infile):
      tmp_infile, tp_dir = setup_infile
      # BET converts the in_file path to be relative to prevent
      # failure with long paths.
      tmp_infile = os.path.relpath(tmp_infile, start=os.getcwd())
      better = fsl.BET()
      assert better.cmd == "bet"
  
      # Test raising error with mandatory args absent
      with pytest.raises(ValueError):
          better.run()
  
      # Test generated outfile name
      better.inputs.in_file = tmp_infile
      outfile = fsl_name(better, "foo_brain")
      realcmd = f"bet {tmp_infile} {outfile}"
      assert better.cmdline == realcmd
      # Test specified outfile name
      outfile = fsl_name(better, "/newdata/bar")
      better.inputs.out_file = outfile
      realcmd = f"bet {tmp_infile} {outfile}"
      assert better.cmdline == realcmd
  
      # infile foo.nii doesn't exist
      def func():
          better.run(in_file="foo2.nii", out_file="bar.nii")
  
      with pytest.raises(TraitError):
          func()
  
      # Our options and some test values for them
      # Should parallel the opt_map structure in the class for clarity
      opt_map = {
          "outline": ("-o", True),
          "mask": ("-m", True),
          "skull": ("-s", True),
          "no_output": ("-n", True),
          "frac": ("-f 0.40", 0.4),
          "vertical_gradient": ("-g 0.75", 0.75),
          "radius": ("-r 20", 20),
          "center": ("-c 54 75 80", [54, 75, 80]),
          "threshold": ("-t", True),
          "mesh": ("-e", True),
          "surfaces": ("-A", True)
          # 'verbose': ('-v', True),
          # 'flags': ('--i-made-this-up', '--i-made-this-up'),
      }
      # Currently we don't test -R, -S, -B, -Z, -F, -A or -A2
  
      # test each of our arguments
      better = fsl.BET()
      outfile = fsl_name(better, "foo_brain")
      for name, settings in list(opt_map.items()):
          better = fsl.BET(**{name: settings[1]})
          # Add mandatory input
          better.inputs.in_file = tmp_infile
          realcmd = " ".join(
              [better.cmd, tmp_infile, outfile, settings[0]]
          )
          assert better.cmdline == realcmd
  
imports: import os
  from copy import deepcopy
  import pytest
  import pdb
  from nipype.utils.filemanip import split_filename, ensure_list
  from ..None import preprocess
  from nipype.interfaces.fsl import Info
  from nipype.interfaces.base import File, TraitError, Undefined, isdefined
  from nipype.interfaces.fsl import no_fsl
label_desc: Use image node_id 3 for calling a global function with example usage: test_bet(setup_infile) without return types