MCPcopy Index your code
hub / github.com/python/cpython / test_venv_changed_name_copy_posix

Method test_venv_changed_name_copy_posix

Lib/test/test_getpath.py:443–472  ·  view source on GitHub ↗

Test a venv --copies layout on *nix that lacks a distributed 'python

(self)

Source from the content-addressed store, hash-verified

441 self.assertEqual(expected, actual)
442
443 def test_venv_changed_name_copy_posix(self):
444 "Test a venv --copies layout on *nix that lacks a distributed 'python'"
445 ns = MockPosixNamespace(
446 argv0="python",
447 PREFIX="/usr",
448 ENV_PATH="/venv/bin:/usr/bin",
449 )
450 ns.add_known_xfile("/usr/bin/python9")
451 ns.add_known_xfile("/venv/bin/python")
452 ns.add_known_file("/usr/lib/python9.8/os.py")
453 ns.add_known_dir("/usr/lib/python9.8/lib-dynload")
454 ns.add_known_file("/venv/pyvenv.cfg", [
455 r"home = /usr/bin"
456 ])
457 expected = dict(
458 executable="/venv/bin/python",
459 prefix="/venv",
460 exec_prefix="/venv",
461 base_executable="/usr/bin/python9",
462 base_prefix="/usr",
463 base_exec_prefix="/usr",
464 module_search_paths_set=1,
465 module_search_paths=[
466 "/usr/lib/python98.zip",
467 "/usr/lib/python9.8",
468 "/usr/lib/python9.8/lib-dynload",
469 ],
470 )
471 actual = getpath(ns, expected)
472 self.assertEqual(expected, actual)
473
474 def test_symlink_normal_posix(self):
475 "Test a 'standard' install layout via symlink on *nix"

Callers

nothing calls this directly

Calls 6

add_known_xfileMethod · 0.95
add_known_fileMethod · 0.95
add_known_dirMethod · 0.95
MockPosixNamespaceClass · 0.85
getpathFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected