code: def test_fslmerge(create_files_in_directory_plus_output_type):
      filelist, outdir, _ = create_files_in_directory_plus_output_type
  
      merger = fsl.Merge()
  
      # make sure command gets called
      assert merger.cmd == "fslmerge"
  
      # test raising error with mandatory args absent
      with pytest.raises(ValueError):
          merger.run()
  
      # .inputs based parameters setting
      merger.inputs.in_files = filelist
      merger.inputs.merged_file = "foo_merged.nii"
      merger.inputs.dimension = "t"
      merger.inputs.output_type = "NIFTI"
      assert (
          merger.cmdline
          == "fslmerge -t foo_merged.nii %s" % " ".join(filelist)
      )
  
      # verify that providing a tr value updates the dimension to tr
      merger.inputs.tr = 2.25
      assert (
          merger.cmdline
          == "fslmerge -tr foo_merged.nii {} {:.2f}".format(
              " ".join(filelist),
              2.25,
          )
      )
  
      # .run based parameter setting
      merger2 = fsl.Merge(
          in_files=filelist,
          merged_file="foo_merged.nii",
          dimension="t",
          output_type="NIFTI",
          tr=2.25,
      )
  
      assert (
          merger2.cmdline
          == "fslmerge -tr foo_merged.nii {} {:.2f}".format(
              " ".join(filelist),
              2.25,
          )
      )
  
file_path: nipype/nipype/interfaces/fsl/tests/test_utils.py
imports: import os
  import numpy
  import nibabel
  import pytest
  import nipype.interfaces.fsl.utils
  from nipype.interfaces.fsl import no_fsl, Info
  from nipype.testing.fixtures import create_files_in_directory_plus_output_type
label_desc: Use image node_id 2 for calling a global function with example usage: test_fslmerge(create_files_in_directory_plus_output_type) without return types