code: def test_unary_maths():
      # Create a node object
      unarym = UnaryMaths()
  
      # Check if the command is properly defined
      cmd = get_custom_path("seg_maths", env_dir="NIFTYSEGDIR")
      assert unarym.cmd == cmd
  
      # test raising error with mandatory args absent
      with pytest.raises(ValueError):
          unarym.run()
  
      # Assign some input data
      in_file = example_data("im1.nii")
      unarym.inputs.in_file = in_file
      unarym.inputs.operation = "otsu"
      unarym.inputs.output_datatype = "float"
  
      expected_cmd = (
          "{cmd} {in_file} -otsu -odt float {out_file}".format(
              cmd=cmd, in_file=in_file, out_file="im1_otsu.nii"
          )
      )
  
      assert unarym.cmdline == expected_cmd
  
file_path: nipype/nipype/interfaces/niftyseg/tests/test_maths.py
imports: import pytest
  from ....testing import example_data
  from ...niftyreg import get_custom_path
  from ...niftyreg.tests.test_regutils import no_nifty_tool
  from ..None import UnaryMaths, BinaryMaths, BinaryMathsInteger, TupleMaths, Merge
label_desc: Use image node_id 1 for calling a global function with example usage: test_unary_maths() without return types