class_docstr: Test venv module functionality.
class_docstr_tok: ["Test","venv","module","functionality","."]
code: def test_prompt(self):
      env_name = os.path.split(self.env_dir)[1]
  
      rmtree(self.env_dir)
      builder = venv.EnvBuilder()
      self.run_with_capture(builder.create, self.env_dir)
      context = builder.ensure_directories(self.env_dir)
      data = self.get_text_file_contents("pyvenv.cfg")
      self.assertEqual(context.prompt, "(%s) " % env_name)
      self.assertNotIn("prompt = ", data)
  
      rmtree(self.env_dir)
      builder = venv.EnvBuilder(prompt="My prompt")
      self.run_with_capture(builder.create, self.env_dir)
      context = builder.ensure_directories(self.env_dir)
      data = self.get_text_file_contents("pyvenv.cfg")
      self.assertEqual(context.prompt, "(My prompt) ")
      self.assertIn("prompt = 'My prompt'\n", data)
  
      rmtree(self.env_dir)
      builder = venv.EnvBuilder(prompt=".")
      cwd = os.path.basename(os.getcwd())
      self.run_with_capture(builder.create, self.env_dir)
      context = builder.ensure_directories(self.env_dir)
      data = self.get_text_file_contents("pyvenv.cfg")
      self.assertEqual(context.prompt, "(%s) " % cwd)
      self.assertIn("prompt = '%s'\n" % cwd, data)
  
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 6 for calling the BasicTest obj's underlying member method code with example usage: obj.test_prompt() without return types