code: def test_make_path():
      # regression test of issue #1478
      # If the figure directory doesn't exist, it should be created
      #
      mdict = {
          "Image": {
              "Metadata_Controls": [1, 0, -1],
              "Metadata_Doses": [0, 0.5, 1],
          },
          INPUT_OBJECTS: {
              TEST_FTR: [
                  numpy.array([1.0, 2.3, 3.4, 2.9]),
                  numpy.array([5.3, 2.4, 3.2]),
                  numpy.array([3.1, 4.3, 2.2, 1.1, 0.1]),
              ]
          },
      }
      workspace, module = make_workspace(
          mdict, "Metadata_Controls", ["Metadata_Doses"]
      )
      assert isinstance(
          module,
          cellprofiler.modules.calculatestatistics.CalculateStatistics,
      )
      my_dir = tempfile.mkdtemp()
      my_subdir = os.path.join(my_dir, "foo")
      fnfilename = FIGURE_NAME + INPUT_OBJECTS + "_" + TEST_FTR + ".pdf"
      fnpath = os.path.join(my_subdir, fnfilename)
      try:
          dose_group = module.dose_values[0]
          dose_group.wants_save_figure.value = True
          dose_group.pathname.dir_choice = (
              cellprofiler_core.preferences.ABSOLUTE_FOLDER_NAME
          )
          dose_group.pathname.custom_path = my_subdir
          dose_group.figure_name.value = FIGURE_NAME
          module.post_run(workspace)
          assert os.path.isfile(fnpath)
      finally:
          if os.path.exists(fnpath):
              os.remove(fnpath)
          if os.path.exists(my_subdir):
              os.rmdir(my_subdir)
          os.rmdir(my_dir)
  
file_path: CellProfiler/tests/frontend/modules/test_calculatestatistics.py
imports: import os
  import tempfile
  import numpy
  import six.moves
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler.modules.calculatestatistics
  import cellprofiler_core.object
  import cellprofiler_core.pipeline
  import cellprofiler_core.preferences
  import cellprofiler_core.setting
  import cellprofiler_core.workspace
  import tests.frontend.modules
label_desc: Use image node_id 4 for calling a global function with example usage: test_make_path() without return types