code: def test_alter_path_regexp():
      module = cellprofiler.modules.createbatchfiles.CreateBatchFiles()
      module.mappings[0].local_directory.value = "foo"
      module.mappings[0].remote_directory.value = "bar"
  
      assert (
          module.alter_path("foo/bar", regexp_substitution=True)
          == "bar/bar"
      )
      assert (
          module.alter_path("baz/bar", regexp_substitution=True)
          == "baz/bar"
      )
  
      module.mappings[0].local_directory.value = r"\foo\baz"
      module.remote_host_is_windows.value = True
      assert (
          module.alter_path(
              r"\\foo\\baz\\bar", regexp_substitution=True
          )
          == r"bar\\bar"
      )
  
file_path: CellProfiler/tests/frontend/modules/test_createbatchfiles.py
imports: import sys
  import pytest
  import six.moves
  import cellprofiler_core.module
  import cellprofiler.modules.createbatchfiles
  import cellprofiler_core.pipeline
  import cellprofiler_core.setting
  import tests.frontend.modules
label_desc: Use image node_id 6 for calling a global function with example usage: test_alter_path_regexp() without return types