()
| 256 | |
| 257 | #[test] |
| 258 | fn test_path_to_module() { |
| 259 | let mut module_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); |
| 260 | module_path.pop(); |
| 261 | module_path.push("flow-python/examples"); |
| 262 | let mut path = PathBuf::from(&module_path); |
| 263 | path.push("logical_test/source.py"); |
| 264 | let ret = path_to_module(&module_path, &path); |
| 265 | assert!(ret.is_ok()); |
| 266 | assert_eq!(ret.unwrap(), "logical_test.source".to_owned()); |
| 267 | |
| 268 | path.pop(); |
| 269 | let ret = path_to_module(&module_path, &path); |
| 270 | assert!(ret.is_ok()); |
| 271 | assert_eq!(ret.unwrap(), "logical_test".to_owned()); |
| 272 | |
| 273 | path.pop(); |
| 274 | let ret = path_to_module(&module_path, &path); |
| 275 | assert!(ret.is_err()); |
| 276 | |
| 277 | path.pop(); |
| 278 | let ret = path_to_module(&module_path, &path); |
| 279 | assert!(ret.is_err()); |
| 280 | } |
| 281 | } |
nothing calls this directly
no test coverage detected