()
| 84 | |
| 85 | #[test] |
| 86 | fn call_python3_twice_works() { |
| 87 | let path = Path::new(OUT_DIR).join("call_python3_twice_works.py"); |
| 88 | // first |
| 89 | let commands_first = "print(\"Python says: Hello World!\")".to_string(); |
| 90 | let output_first = call_python3("python3", &commands_first, &path).unwrap(); |
| 91 | let data_first = fs::read_to_string(&path).map_err(|_| "cannot read test file").unwrap(); |
| 92 | let correct_first = "print(\"Python says: Hello World!\")".to_string(); |
| 93 | assert_eq!(data_first, correct_first); |
| 94 | assert_eq!(output_first, "Python says: Hello World!\n"); |
| 95 | // second |
| 96 | let commands_second = "print(\"Python says: Hello World! again\")".to_string(); |
| 97 | let output_second = call_python3("python3", &commands_second, &path).unwrap(); |
| 98 | let data_second = fs::read_to_string(&path).map_err(|_| "cannot read test file").unwrap(); |
| 99 | let correct_second = "print(\"Python says: Hello World! again\")".to_string(); |
| 100 | assert_eq!(data_second, correct_second); |
| 101 | assert_eq!(output_second, "Python says: Hello World! again\n"); |
| 102 | } |
| 103 | } |
nothing calls this directly
no test coverage detected