code: def test_run_interface(tmpdir):
      default_script_file = (
          clean_workspace_and_get_default_script_file()
      )
  
      mc = mlab.MatlabCommand(matlab_cmd="foo_m")
      assert not os.path.exists(
          default_script_file
      ), "scriptfile should not exist 1."
      with pytest.raises(ValueError):
          mc.run()  # script is mandatory
      assert not os.path.exists(
          default_script_file
      ), "scriptfile should not exist 2."
      if os.path.exists(default_script_file):  # cleanup
          os.remove(default_script_file)
  
      mc.inputs.script = "a=1;"
      assert not os.path.exists(
          default_script_file
      ), "scriptfile should not exist 3."
      with pytest.raises(IOError):
          mc.run()  # foo_m is not an executable
      assert os.path.exists(
          default_script_file
      ), "scriptfile should exist 3."
      if os.path.exists(default_script_file):  # cleanup
          os.remove(default_script_file)
  
      cwd = tmpdir.chdir()
  
      # bypasses ubuntu dash issue
      mc = mlab.MatlabCommand(
          script="foo;", paths=[tmpdir.strpath], mfile=True
      )
      assert not os.path.exists(
          default_script_file
      ), "scriptfile should not exist 4."
      with pytest.raises(OSError):
          mc.run()
      assert os.path.exists(
          default_script_file
      ), "scriptfile should exist 4."
      if os.path.exists(default_script_file):  # cleanup
          os.remove(default_script_file)
  
      # bypasses ubuntu dash issue
      res = mlab.MatlabCommand(
          script="a=1;", paths=[tmpdir.strpath], mfile=True
      ).run()
      assert res.runtime.returncode == 0
      assert os.path.exists(
          default_script_file
      ), "scriptfile should exist 5."
      cwd.chdir()
  
file_path: nipype/nipype/interfaces/tests/test_matlab.py
imports: import os
  import pytest
  import nipype.interfaces.matlab
label_desc: Use image node_id 5 for calling a global function with example usage: test_run_interface(tmpdir) without return types