class_docstr: Test venv module functionality.
class_docstr_tok: ["Test","venv","module","functionality","."]
code: def test_upgrade_dependencies(self):
      builder = venv.EnvBuilder()
      bin_path = "Scripts" if sys.platform == "win32" else "bin"
      python_exe = os.path.split(sys.executable)[1]
      with tempfile.TemporaryDirectory() as fake_env_dir:
          expect_exe = os.path.normcase(
              os.path.join(fake_env_dir, bin_path, python_exe)
          )
          if sys.platform == "win32":
              expect_exe = os.path.normcase(
                  os.path.realpath(expect_exe)
              )
  
          def pip_cmd_checker(cmd, **kwargs):
              cmd[0] = os.path.normcase(cmd[0])
              self.assertEqual(
                  cmd,
                  [
                      expect_exe,
                      "-m",
                      "pip",
                      "install",
                      "--upgrade",
                      "pip",
                  ],
              )
  
          fake_context = builder.ensure_directories(fake_env_dir)
          with patch("venv.subprocess.check_output", pip_cmd_checker):
              builder.upgrade_dependencies(fake_context)
  
imports: import contextlib
  import ensurepip
  import os
  import os.path
  import pathlib
  import re
  import shutil
  import struct
  import subprocess
  import sys
  import sysconfig
  import tempfile
  from test.support import captured_stdout, captured_stderr, skip_if_broken_multiprocessing_synchronize, verbose, requires_subprocess, is_emscripten, is_wasi, requires_venv_with_pip, TEST_HOME_DIR, requires_resource, copy_python_src_ignore
  from test.support.os_helper import can_symlink, EnvironmentVarGuard, rmtree
  import unittest
  import venv
  from unittest.mock import patch, Mock
label_desc: Use image node_id 7 for calling the BasicTest obj's underlying member method code with example usage: obj.test_upgrade_dependencies() without return types