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)
| 291 | self.assertEqual(expected, actual) |
| 292 | |
| 293 | def test_buildpath_posix(self): |
| 294 | """Test an in-build-tree layout on POSIX. |
| 295 | |
| 296 | This layout is discovered from the presence of pybuilddir.txt, which |
| 297 | contains the relative path from the executable's directory to the |
| 298 | platstdlib path. |
| 299 | """ |
| 300 | ns = MockPosixNamespace( |
| 301 | argv0=r"/home/cpython/python", |
| 302 | PREFIX="/usr/local", |
| 303 | ) |
| 304 | ns.add_known_xfile("/home/cpython/python") |
| 305 | ns.add_known_xfile("/usr/local/bin/python") |
| 306 | ns.add_known_file("/home/cpython/pybuilddir.txt", ["build/lib.linux-x86_64-9.8"]) |
| 307 | ns.add_known_file("/home/cpython/Lib/os.py") |
| 308 | ns.add_known_dir("/home/cpython/lib-dynload") |
| 309 | expected = dict( |
| 310 | executable="/home/cpython/python", |
| 311 | prefix="/usr/local", |
| 312 | exec_prefix="/usr/local", |
| 313 | base_executable="/home/cpython/python", |
| 314 | build_prefix="/home/cpython", |
| 315 | _is_python_build=1, |
| 316 | module_search_paths_set=1, |
| 317 | module_search_paths=[ |
| 318 | "/usr/local/lib/python98.zip", |
| 319 | "/home/cpython/Lib", |
| 320 | "/home/cpython/build/lib.linux-x86_64-9.8", |
| 321 | ], |
| 322 | ) |
| 323 | actual = getpath(ns, expected) |
| 324 | self.assertEqual(expected, actual) |
| 325 | |
| 326 | def test_venv_posix(self): |
| 327 | "Test a venv layout on *nix." |
nothing calls this directly
no test coverage detected