code: def test_gen_fname(args, desired_name):
      # Test _gen_fname method of FSLCommand
      cmd = fsl.FSLCommand(command="junk", output_type="NIFTI_GZ")
      pth = os.getcwd()
      fname = cmd._gen_fname("foo.nii.gz", **args)
      if "dir" in desired_name.keys():
          desired = os.path.join(
              desired_name["dir"], desired_name["file"]
          )
      else:
          desired = os.path.join(pth, desired_name["file"])
      assert fname == desired
  
file_path: nipype/nipype/interfaces/fsl/tests/test_base.py
imports: import os
  import nipype.interfaces.fsl
  from nipype.interfaces.base import InterfaceResult
  from nipype.interfaces.fsl import check_fsl, no_fsl
  import pytest
label_desc: Use image node_id 6 for calling a global function with example usage: test_gen_fname(args, desired_name) without return types