MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_read_home

Function test_read_home

crates/venvlauncher/src/main.rs:112–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110
111 #[test]
112 fn test_read_home() {
113 let temp_dir = std::env::temp_dir();
114 let cfg_path = temp_dir.join("test_pyvenv.cfg");
115
116 let mut file = fs::File::create(&cfg_path).unwrap();
117 writeln!(file, "home = C:\\Python314").unwrap();
118 writeln!(file, "include-system-site-packages = false").unwrap();
119 writeln!(file, "version = 3.14.0").unwrap();
120
121 let home = read_home(&cfg_path).unwrap();
122 assert_eq!(home, "C:\\Python314");
123
124 fs::remove_file(&cfg_path).unwrap();
125 }
126
127 #[test]
128 fn test_read_home_no_spaces() {

Callers

nothing calls this directly

Calls 5

temp_dirFunction · 0.85
read_homeFunction · 0.85
createFunction · 0.50
joinMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected