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

Method test_symlink_buildpath_posix

Lib/test/test_getpath.py:500–533  ·  view source on GitHub ↗

Test an in-build-tree layout on POSIX. This layout is discovered from the presence of pybuilddir.txt, which contains the relative path from the executable's directory to the platstdlib path.

(self)

Source from the content-addressed store, hash-verified

498 self.assertEqual(expected, actual)
499
500 def test_symlink_buildpath_posix(self):
501 """Test an in-build-tree layout on POSIX.
502
503 This layout is discovered from the presence of pybuilddir.txt, which
504 contains the relative path from the executable's directory to the
505 platstdlib path.
506 """
507 ns = MockPosixNamespace(
508 argv0=r"/linkfrom/python",
509 PREFIX="/usr/local",
510 )
511 ns.add_known_xfile("/linkfrom/python")
512 ns.add_known_xfile("/home/cpython/python")
513 ns.add_known_link("/linkfrom/python", "/home/cpython/python")
514 ns.add_known_xfile("/usr/local/bin/python")
515 ns.add_known_file("/home/cpython/pybuilddir.txt", ["build/lib.linux-x86_64-9.8"])
516 ns.add_known_file("/home/cpython/Lib/os.py")
517 ns.add_known_dir("/home/cpython/lib-dynload")
518 expected = dict(
519 executable="/linkfrom/python",
520 prefix="/usr/local",
521 exec_prefix="/usr/local",
522 base_executable="/linkfrom/python",
523 build_prefix="/home/cpython",
524 _is_python_build=1,
525 module_search_paths_set=1,
526 module_search_paths=[
527 "/usr/local/lib/python98.zip",
528 "/home/cpython/Lib",
529 "/home/cpython/build/lib.linux-x86_64-9.8",
530 ],
531 )
532 actual = getpath(ns, expected)
533 self.assertEqual(expected, actual)
534
535 def test_custom_platlibdir_posix(self):
536 "Test an install with custom platlibdir on *nix"

Callers

nothing calls this directly

Calls 7

add_known_xfileMethod · 0.95
add_known_linkMethod · 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