code: def test_surfshots(create_files_in_directory_plus_dummy_file):
      fotos = fs.SurfaceSnapshots()
  
      # Test underlying command
      assert fotos.cmd == "tksurfer"
  
      # Test mandatory args exception
      with pytest.raises(ValueError):
          fotos.run()
  
      # Create testing files
      files, cwd = create_files_in_directory_plus_dummy_file
  
      # Test input settings
      fotos.inputs.subject_id = "fsaverage"
      fotos.inputs.hemi = "lh"
      fotos.inputs.surface = "pial"
  
      # Test a basic command line
      assert (
          fotos.cmdline
          == "tksurfer fsaverage lh pial -tcl snapshots.tcl"
      )
  
      # Test identity
      schmotos = fs.SurfaceSnapshots(
          subject_id="mysubject", hemi="rh", surface="white"
      )
      assert fotos != schmotos
  
      # Test that the tcl script gets written
      fotos._write_tcl_script()
      assert os.path.exists("snapshots.tcl")
  
      # Test that we can use a different tcl script
      foo = open("other.tcl", "w").close()
      fotos.inputs.tcl_script = "other.tcl"
      assert (
          fotos.cmdline == "tksurfer fsaverage lh pial -tcl other.tcl"
      )
  
      # Test that the interface crashes politely if graphics aren't enabled
      try:
          hold_display = os.environ["DISPLAY"]
          del os.environ["DISPLAY"]
          with pytest.raises(RuntimeError):
              fotos.run()
          os.environ["DISPLAY"] = hold_display
      except KeyError:
          pass
  
file_path: nipype/nipype/interfaces/freesurfer/tests/test_utils.py
imports: import os
  import os.path
  import pytest
  from nipype.testing.fixtures import create_files_in_directory_plus_dummy_file, create_surf_file_in_directory
  from nipype.pipeline import engine
  from nipype.interfaces import freesurfer
  from nipype.interfaces.base import TraitError
  from nipype.interfaces.io import FreeSurferSource
label_desc: Use image node_id 4 for calling a global function with example usage: test_surfshots(create_files_in_directory_plus_dummy_file) without return types