Skip to content

Commit adca94b

Browse files
committed
add test
1 parent 3334b2b commit adca94b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Lib/test/test_getpath.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,27 @@ def test_venv_posix(self):
354354
actual = getpath(ns, expected)
355355
self.assertEqual(expected, actual)
356356

357+
def test_venv_posix_without_home_key(self):
358+
ns = MockPosixNamespace(
359+
argv0="/venv/bin/python3",
360+
PREFIX="/usr",
361+
ENV_PATH="/usr/bin",
362+
)
363+
# Setup the bare minimum venv
364+
ns.add_known_xfile("/usr/bin/python3")
365+
ns.add_known_xfile("/venv/bin/python3")
366+
ns.add_known_link("/venv/bin/python3", "/usr/bin/python3")
367+
ns.add_known_file("/venv/pyvenv.cfg", [
368+
# home = key intentionally omitted
369+
])
370+
expected = dict(
371+
executable="/venv/bin/python3",
372+
prefix="/venv",
373+
base_prefix="/usr",
374+
)
375+
actual = getpath(ns, expected)
376+
self.assertEqual(expected, actual)
377+
357378
def test_venv_changed_name_posix(self):
358379
"Test a venv layout on *nix."
359380
ns = MockPosixNamespace(

0 commit comments

Comments
 (0)