code: def testEphemeralPackageMocked(
      self, mock_subprocess_call, mock_mkdtemp
  ):
      source_data_dir = os.path.join(
          os.path.dirname(os.path.abspath(__file__)), "testdata"
      )
      test_file = os.path.join(source_data_dir, "test.csv")
      expected_package = "mypackage.tar.gz"
  
      def side_effect(cmd, stdout, stderr):
          self.assertLen(cmd, 3)
          self.assertEqual(sys.executable, cmd[0])
          self.assertEqual("sdist", cmd[2])
          self.assertEqual(stdout, stderr)
          setup_file = cmd[1]
          dist_dir = os.path.join(os.path.dirname(setup_file), "dist")
          fileio.makedirs(dist_dir)
          dest_file = os.path.join(dist_dir, expected_package)
          fileio.copy(test_file, dest_file)
  
      mock_subprocess_call.side_effect = side_effect
      mock_mkdtemp.return_value = self._tmp_dir
      package = dependency_utils.build_ephemeral_package()
      self.assertEqual(expected_package, os.path.basename(package))
  
file_path: tfx/tfx/utils/dependency_utils_test.py
imports: import os
  import sys
  from unittest import mock
  from absl import logging
  from absl.testing import parameterized
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.utils import dependency_utils
label_desc: Use image node_id 5 for calling the DependencyUtilsTest obj's underlying member method code with example usage: obj.testEphemeralPackageMocked(mock_subprocess_call, mock_mkdtemp) without return types