code: def test_dtifit2(create_files_in_directory):
      filelist, outdir = create_files_in_directory
      dti = fsl.DTIFit()
      # make sure command gets called
      assert dti.cmd == "dtifit"
  
      # test raising error with mandatory args absent
      with pytest.raises(ValueError):
          dti.run()
  
      # .inputs based parameters setting
      dti.inputs.dwi = filelist[0]
      dti.inputs.base_name = "foo.dti.nii"
      dti.inputs.mask = filelist[1]
      dti.inputs.bvecs = filelist[0]
      dti.inputs.bvals = filelist[1]
      dti.inputs.min_z = 10
      dti.inputs.max_z = 50
  
      assert (
          dti.cmdline
          == "dtifit -k %s -o foo.dti.nii -m %s -r %s -b %s -Z 50 -z 10"
          % (filelist[0], filelist[1], filelist[0], filelist[1])
      )
  
file_path: nipype/nipype/interfaces/fsl/tests/test_dti.py
imports: import os
  import nipype.interfaces.fsl.dti
  from nipype.interfaces.fsl import Info, no_fsl
  from nipype.interfaces.base import Undefined
  import pytest
  from nipype.testing.fixtures import create_files_in_directory
label_desc: Use image node_id 1 for calling a global function with example usage: test_dtifit2(create_files_in_directory) without return types