()
| 132 | #[traced_test] |
| 133 | #[tokio::test] |
| 134 | async fn test_storage_path_readonly() -> Result<()> { |
| 135 | use std::os::unix::fs::PermissionsExt; |
| 136 | |
| 137 | let (db, _path, dir) = setup_test_db().await; |
| 138 | let test_path = dir.path().join("readonly"); |
| 139 | std::fs::create_dir(&test_path)?; |
| 140 | |
| 141 | // Make directory read-only |
| 142 | std::fs::set_permissions(&test_path, std::fs::Permissions::from_mode(0o444))?; |
| 143 | |
| 144 | let result = db.set_storage_path(&test_path).await; |
| 145 | assert!(matches!( |
| 146 | result, |
| 147 | Err(LearnerError::Path(e)) if e.kind() == std::io::ErrorKind::PermissionDenied |
| 148 | )); |
| 149 | Ok(()) |
| 150 | } |
nothing calls this directly
no test coverage detected