code: def test_eddy_correct2(create_files_in_directory):
      filelist, outdir = create_files_in_directory
      eddy = fsl.EddyCorrect()
  
      # make sure command gets called
      assert eddy.cmd == "eddy_correct"
  
      # test raising error with mandatory args absent
      with pytest.raises(ValueError):
          eddy.run()
  
      # .inputs based parameters setting
      eddy.inputs.in_file = filelist[0]
      eddy.inputs.out_file = "foo_eddc.nii"
      eddy.inputs.ref_num = 100
      assert (
          eddy.cmdline
          == "eddy_correct %s foo_eddc.nii 100" % filelist[0]
      )
  
      # .run based parameter setting
      eddy2 = fsl.EddyCorrect(
          in_file=filelist[0], out_file="foo_ec.nii", ref_num=20
      )
      assert (
          eddy2.cmdline == "eddy_correct %s foo_ec.nii 20" % filelist[0]
      )
  
imports: import os
  import pytest
  from nipype.testing.fixtures import create_files_in_directory
  import nipype.interfaces.fsl.epi
  from nipype.interfaces.fsl import no_fsl
label_desc: Use image node_id 1 for calling a global function with example usage: test_eddy_correct2(create_files_in_directory) without return types