code: def test_fit_dwi():
      """Testing FitDwi interface."""
      # Create a node object
      fit_dwi = FitDwi()
  
      # Check if the command is properly defined
      cmd = get_custom_path("fit_dwi", env_dir="NIFTYFITDIR")
      assert fit_dwi.cmd == cmd
  
      # test raising error with mandatory args absent
      with pytest.raises(ValueError):
          fit_dwi.run()
  
      # Assign some input data
      in_file = example_data("dwi.nii.gz")
      bval_file = example_data("bvals")
      bvec_file = example_data("bvecs")
      fit_dwi.inputs.source_file = in_file
      fit_dwi.inputs.bval_file = bval_file
      fit_dwi.inputs.bvec_file = bvec_file
      fit_dwi.inputs.dti_flag = True
  
      cmd_tmp = "{cmd} -source {in_file} -bval {bval} -bvec {bvec} -dti \
  -error {error} -famap {fa} -mcmap {mc} -mcout {mcout} -mdmap {md} -nodiff \
  {nodiff} -res {res} -rgbmap {rgb} -syn {syn} -tenmap2 {ten2}  -v1map {v1}"
  
      expected_cmd = cmd_tmp.format(
          cmd=cmd,
          in_file=in_file,
          bval=bval_file,
          bvec=bvec_file,
          error="dwi_error.nii.gz",
          fa="dwi_famap.nii.gz",
          mc="dwi_mcmap.nii.gz",
          md="dwi_mdmap.nii.gz",
          nodiff="dwi_no_diff.nii.gz",
          res="dwi_resmap.nii.gz",
          rgb="dwi_rgbmap.nii.gz",
          syn="dwi_syn.nii.gz",
          ten2="dwi_tenmap2.nii.gz",
          v1="dwi_v1map.nii.gz",
          mcout="dwi_mcout.txt",
      )
  
      assert fit_dwi.cmdline == expected_cmd
  
imports: import pytest
  from ....testing import example_data
  from ...niftyreg import get_custom_path
  from ..dwi import FitDwi, DwiTool
  from ...niftyreg.tests.test_regutils import no_nifty_tool
label_desc: Use image node_id 1 for calling a global function with example usage: test_fit_dwi() without return types