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

Method test_symlink_buildtree_win32

Lib/test/test_getpath.py:187–213  ·  view source on GitHub ↗

Test an in-build-tree layout via symlink on Windows.

(self)

Source from the content-addressed store, hash-verified

185 self.assertEqual(expected, actual)
186
187 def test_symlink_buildtree_win32(self):
188 "Test an in-build-tree layout via symlink on Windows."
189 ns = MockNTNamespace(
190 argv0=r"C:\LinkedFrom\python.exe",
191 real_executable=r"C:\CPython\PCbuild\amd64\python.exe",
192 )
193 ns.add_known_xfile(r"C:\LinkedFrom\python.exe")
194 ns.add_known_xfile(r"C:\CPython\PCbuild\amd64\python.exe")
195 ns.add_known_link(r"C:\LinkedFrom\python.exe", r"C:\CPython\PCbuild\amd64\python.exe")
196 ns.add_known_file(r"C:\CPython\Lib\os.py")
197 ns.add_known_file(r"C:\CPython\PCbuild\amd64\pybuilddir.txt", [""])
198 expected = dict(
199 executable=r"C:\LinkedFrom\python.exe",
200 base_executable=r"C:\LinkedFrom\python.exe",
201 prefix=r"C:\CPython",
202 exec_prefix=r"C:\CPython",
203 build_prefix=r"C:\CPython",
204 _is_python_build=1,
205 module_search_paths_set=1,
206 module_search_paths=[
207 r"C:\CPython\PCbuild\amd64\python98.zip",
208 r"C:\CPython\PCbuild\amd64",
209 r"C:\CPython\Lib",
210 ],
211 )
212 actual = getpath(ns, expected)
213 self.assertEqual(expected, actual)
214
215 def test_buildtree_pythonhome_win32(self):
216 "Test an out-of-build-tree layout on Windows with PYTHONHOME override."

Callers

nothing calls this directly

Calls 6

add_known_xfileMethod · 0.95
add_known_linkMethod · 0.95
add_known_fileMethod · 0.95
MockNTNamespaceClass · 0.85
getpathFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected