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

Method test_framework_macos

Lib/test/test_getpath.py:560–599  ·  view source on GitHub ↗

Test framework layout on macOS This layout is primarily detected using a compile-time option (WITH_NEXT_FRAMEWORK).

(self)

Source from the content-addressed store, hash-verified

558 self.assertEqual(expected, actual)
559
560 def test_framework_macos(self):
561 """ Test framework layout on macOS
562
563 This layout is primarily detected using a compile-time option
564 (WITH_NEXT_FRAMEWORK).
565 """
566 ns = MockPosixNamespace(
567 os_name="darwin",
568 argv0="/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python",
569 WITH_NEXT_FRAMEWORK=1,
570 PREFIX="/Library/Frameworks/Python.framework/Versions/9.8",
571 EXEC_PREFIX="/Library/Frameworks/Python.framework/Versions/9.8",
572 ENV___PYVENV_LAUNCHER__="/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8",
573 real_executable="/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python",
574 library="/Library/Frameworks/Python.framework/Versions/9.8/Python",
575 )
576 ns.add_known_xfile("/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python")
577 ns.add_known_xfile("/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8")
578 ns.add_known_dir("/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/lib-dynload")
579 ns.add_known_file("/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/os.py")
580
581 # This is definitely not the stdlib (see discussion in bpo-46890)
582 #ns.add_known_file("/Library/Frameworks/lib/python98.zip")
583
584 expected = dict(
585 executable="/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8",
586 prefix="/Library/Frameworks/Python.framework/Versions/9.8",
587 exec_prefix="/Library/Frameworks/Python.framework/Versions/9.8",
588 base_executable="/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8",
589 base_prefix="/Library/Frameworks/Python.framework/Versions/9.8",
590 base_exec_prefix="/Library/Frameworks/Python.framework/Versions/9.8",
591 module_search_paths_set=1,
592 module_search_paths=[
593 "/Library/Frameworks/Python.framework/Versions/9.8/lib/python98.zip",
594 "/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8",
595 "/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/lib-dynload",
596 ],
597 )
598 actual = getpath(ns, expected)
599 self.assertEqual(expected, actual)
600
601 def test_alt_framework_macos(self):
602 """ Test framework layout on macOS with alternate framework name

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected