MCPcopy Create free account
hub / github.com/Autoparallel/learner / test_storage_path_readonly

Function test_storage_path_readonly

crates/learner/src/database/tests.rs:134–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

132#[traced_test]
133#[tokio::test]
134async 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}

Callers

nothing calls this directly

Calls 3

setup_test_dbFunction · 0.85
pathMethod · 0.80
set_storage_pathMethod · 0.80

Tested by

no test coverage detected