code: def test_reg_resample_res():
      """tests for reg_resample interface"""
      # Create a reg_resample object
      nr_resample = RegResample()
  
      # Check if the command is properly defined
      assert nr_resample.cmd == get_custom_path("reg_resample")
  
      # test raising error with mandatory args absent
      with pytest.raises(ValueError):
          nr_resample.run()
  
      # Resample res
      ref_file = example_data("im1.nii")
      flo_file = example_data("im2.nii")
      trans_file = example_data("warpfield.nii")
      nr_resample.inputs.ref_file = ref_file
      nr_resample.inputs.flo_file = flo_file
      nr_resample.inputs.trans_file = trans_file
      nr_resample.inputs.inter_val = "LIN"
      nr_resample.inputs.omp_core_val = 4
  
      cmd_tmp = "{cmd} -flo {flo} -inter 1 -omp 4 -ref {ref} -trans {trans} \
  -res {res}"
  
      expected_cmd = cmd_tmp.format(
          cmd=get_custom_path("reg_resample"),
          flo=flo_file,
          ref=ref_file,
          trans=trans_file,
          res="im2_res.nii.gz",
      )
  
      assert nr_resample.cmdline == expected_cmd
  
      # test_reg_resample_blank()
      nr_resample_2 = RegResample(
          type="blank", inter_val="LIN", omp_core_val=4
      )
      ref_file = example_data("im1.nii")
      flo_file = example_data("im2.nii")
      trans_file = example_data("warpfield.nii")
      nr_resample_2.inputs.ref_file = ref_file
      nr_resample_2.inputs.flo_file = flo_file
      nr_resample_2.inputs.trans_file = trans_file
  
      cmd_tmp = "{cmd} -flo {flo} -inter 1 -omp 4 -ref {ref} -trans {trans} \
  -blank {blank}"
  
      expected_cmd = cmd_tmp.format(
          cmd=get_custom_path("reg_resample"),
          flo=flo_file,
          ref=ref_file,
          trans=trans_file,
          blank="im2_blank.nii.gz",
      )
  
      assert nr_resample_2.cmdline == expected_cmd
  
file_path: nipype/nipype/interfaces/niftyreg/tests/test_regutils.py
imports: import os
  import pytest
  from ....utils.filemanip import which
  from ....testing import example_data
  from ..None import get_custom_path, RegAverage, RegResample, RegJacobian, RegTools, RegMeasure, RegTransform
label_desc: Use image node_id 2 for calling a global function with example usage: test_reg_resample_res() without return types