Python
Settings: OpenShell is not available on Windows yet; setup test reads the status header
Rohit C Prasade84e879e6e5a
diff --git a/coworker/sandbox/settings.py b/coworker/sandbox/settings.pyindex e914fdd3..db1cf2b5 100644--- a/coworker/sandbox/settings.py+++ b/coworker/sandbox/settings.py@@ -28,6 +28,8 @@ def _availability(name: str) -> tuple[bool, str]:except seatbelt.SeatbeltUnavailable as exc:return False, str(exc)if name == OPENSHELL:+ if sys.platform == "win32": # its Windows driver is a preview; the setup command here sets up the Windows sandbox+ return False, "OpenShell is not available on Windows yet."from .selection import openshell_problemproblem = openshell_problem()diff --git a/tests/test_sandbox_windows.py b/tests/test_sandbox_windows.pyindex 0f4215c4..6ebad1f1 100644--- a/tests/test_sandbox_windows.py+++ b/tests/test_sandbox_windows.py@@ -228,7 +228,7 @@ def test_setup_creates_the_two_hidden_accounts_and_status_reports_it():rule = subprocess.run(["powershell", "-NoProfile", "-Command", f"(Get-NetFirewallRule -DisplayName '{windows_setup.FIREWALL_RULE}').Enabled"], capture_output=True, text=True).stdoutassert "True" in ruleassert windows_setup.filters_recorded() and windows_wfp.present() in (True, None)- windows_rows = said[: next((i for i, line in enumerate(said) if line.startswith("OpenShell on this machine")), len(said))]+ windows_rows = said[: next((i for i, line in enumerate(said) if line.strip().startswith("OpenShell on this machine")), len(said))]assert any("setup has run" in line for line in windows_rows) and all("[--]" not in line for line in windows_rows)info = windows_setup.info()assert info["state"] == "ready" and info["set_up_at"].endswith("Z") and info["can_elevate"]