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

Method test_symlink_normal_macos

Lib/test/test_getpath.py:773–801  ·  view source on GitHub ↗

Test a 'standard' install layout via symlink on macOS

(self)

Source from the content-addressed store, hash-verified

771 self.assertEqual(expected, actual)
772
773 def test_symlink_normal_macos(self):
774 "Test a 'standard' install layout via symlink on macOS"
775 ns = MockPosixNamespace(
776 os_name="darwin",
777 PREFIX="/usr",
778 argv0="python",
779 ENV_PATH="/linkfrom:/usr/bin",
780 # real_executable on macOS matches the invocation path
781 real_executable="/linkfrom/python",
782 )
783 ns.add_known_xfile("/linkfrom/python")
784 ns.add_known_xfile("/usr/bin/python")
785 ns.add_known_link("/linkfrom/python", "/usr/bin/python")
786 ns.add_known_file("/usr/lib/python9.8/os.py")
787 ns.add_known_dir("/usr/lib/python9.8/lib-dynload")
788 expected = dict(
789 executable="/linkfrom/python",
790 base_executable="/linkfrom/python",
791 prefix="/usr",
792 exec_prefix="/usr",
793 module_search_paths_set=1,
794 module_search_paths=[
795 "/usr/lib/python98.zip",
796 "/usr/lib/python9.8",
797 "/usr/lib/python9.8/lib-dynload",
798 ],
799 )
800 actual = getpath(ns, expected)
801 self.assertEqual(expected, actual)
802
803 def test_symlink_buildpath_macos(self):
804 """Test an in-build-tree layout via symlink on macOS.

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