From 03e0052379cbe8d64fb26fb842ab14a68f594e8a Mon Sep 17 00:00:00 2001 From: Myles Anderson Date: Wed, 30 Sep 2026 12:36:25 -0700 Subject: [PATCH] Test that Git Bash executes the generated python shims Co-Authored-By: Claude Opus 5.5 --- src/jobs/localbox/python.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/jobs/localbox/python.rs b/src/jobs/localbox/python.rs index 2ad4643b..10059054 100644 --- a/src/jobs/localbox/python.rs +++ b/src/jobs/localbox/python.rs @@ -142,6 +142,27 @@ mod tests { assert!(script.ends_with(">&2\nexit 127\n")); } + #[test] + fn git_bash_runs_the_shims_and_python3_reaches_the_error() { + let dir = std::env::temp_dir().join(format!("orx-shims-{}", uuid::Uuid::new_v4())); + std::fs::create_dir_all(&dir).unwrap(); + std::fs::write(dir.join("python"), stub_shim()).unwrap(); + std::fs::write(dir.join("python3"), FORWARD_TO_PYTHON).unwrap(); + let mut path = std::ffi::OsString::from(&dir); + if let Some(rest) = crate::local::shell_env::search_path() { + path.push(";"); + path.push(rest); + } + let out = Command::new(crate::local::bash::program()) + .args(["-c", "python3 --version"]) + .env("PATH", path) + .output() + .unwrap(); + assert_eq!(out.status.code(), Some(127)); + assert!(String::from_utf8_lossy(&out.stderr).contains("Microsoft Store alias")); + std::fs::remove_dir_all(dir).unwrap(); + } + #[test] fn a_forward_slashed_path_entry_is_still_windows_apps() { assert!(in_windows_apps(Path::new(