Python
Test: the private-folder check compares against the system temp dir, not the "/tmp" prefix
Devika Vermab828796d4a75
diff --git a/tests/test_sandbox_openshell.py b/tests/test_sandbox_openshell.pyindex cc3fb23b..e4b87337 100644--- a/tests/test_sandbox_openshell.py+++ b/tests/test_sandbox_openshell.py@@ -9,6 +9,7 @@ from __future__ import annotationsimport osimport shutil+import tempfileimport subprocessimport threadingimport time@@ -235,7 +236,9 @@ def test_the_private_folder_is_visible_to_the_gateway_and_to_no_sandbox(tmp_pathprivate = Path(provider._tmp)assert private.parent == tmp_path / openshell.RUNTIME_DIR_NAMEassert not str(private).startswith(str(tmp_path / "sandbox") + os.sep) # not inside the mounted folder- assert not str(private).startswith("/tmp")+ # Not in the system temp dir itself (the old place). The state dir under test may well+ # live under /tmp (pytest's default basetemp on CI), so compare parents, not prefixes.+ assert private.parent != Path(tempfile.gettempdir()).resolve() and private.parent.name == openshell.RUNTIME_DIR_NAMEassert private.name.startswith(f"ow-openshell-{os.getpid()}-")if os.name != "nt":assert (private.parent.stat().st_mode & 0o777) == 0o700