style: apply rustfmt to async fs updates
This commit is contained in:
parent
b9af601943
commit
275d3e7791
11 changed files with 44 additions and 17 deletions
|
|
@ -481,7 +481,9 @@ mod tests {
|
|||
config_path: tmp.path().join("config.toml"),
|
||||
..Config::default()
|
||||
};
|
||||
tokio::fs::create_dir_all(&config.workspace_dir).await.unwrap();
|
||||
tokio::fs::create_dir_all(&config.workspace_dir)
|
||||
.await
|
||||
.unwrap();
|
||||
config
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,9 @@ mod tests {
|
|||
{
|
||||
let source_dir = tmp.path().join("source_skill");
|
||||
tokio::fs::create_dir_all(&source_dir).await.unwrap();
|
||||
tokio::fs::write(source_dir.join("SKILL.md"), "# Test Skill\nContent").await.unwrap();
|
||||
tokio::fs::write(source_dir.join("SKILL.md"), "# Test Skill\nContent")
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let dest_link = skills_path.join("linked_skill");
|
||||
|
||||
|
|
@ -94,7 +96,9 @@ mod tests {
|
|||
// Test case: Symlink outside workspace should be allowed (user responsibility)
|
||||
let outside_dir = tmp.path().join("outside_skill");
|
||||
tokio::fs::create_dir_all(&outside_dir).await.unwrap();
|
||||
tokio::fs::write(outside_dir.join("SKILL.md"), "# Outside Skill\nContent").await.unwrap();
|
||||
tokio::fs::write(outside_dir.join("SKILL.md"), "# Outside Skill\nContent")
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let dest_link = skills_path.join("outside_skill");
|
||||
let result = std::os::unix::fs::symlink(&outside_dir, &dest_link);
|
||||
|
|
|
|||
|
|
@ -1225,9 +1225,9 @@ mod native_backend {
|
|||
});
|
||||
|
||||
if let Some(path_str) = path {
|
||||
tokio::fs::write(&path_str, &png).await.with_context(|| {
|
||||
format!("Failed to write screenshot to {path_str}")
|
||||
})?;
|
||||
tokio::fs::write(&path_str, &png)
|
||||
.await
|
||||
.with_context(|| format!("Failed to write screenshot to {path_str}"))?;
|
||||
payload["path"] = Value::String(path_str);
|
||||
} else {
|
||||
payload["png_base64"] =
|
||||
|
|
|
|||
|
|
@ -223,7 +223,9 @@ mod tests {
|
|||
config_path: tmp.path().join("config.toml"),
|
||||
..Config::default()
|
||||
};
|
||||
tokio::fs::create_dir_all(&config.workspace_dir).await.unwrap();
|
||||
tokio::fs::create_dir_all(&config.workspace_dir)
|
||||
.await
|
||||
.unwrap();
|
||||
Arc::new(config)
|
||||
}
|
||||
|
||||
|
|
@ -262,7 +264,9 @@ mod tests {
|
|||
};
|
||||
config.autonomy.allowed_commands = vec!["echo".into()];
|
||||
config.autonomy.level = AutonomyLevel::Supervised;
|
||||
tokio::fs::create_dir_all(&config.workspace_dir).await.unwrap();
|
||||
tokio::fs::create_dir_all(&config.workspace_dir)
|
||||
.await
|
||||
.unwrap();
|
||||
let cfg = Arc::new(config);
|
||||
let tool = CronAddTool::new(cfg.clone(), test_security(&cfg));
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,9 @@ mod tests {
|
|||
config_path: tmp.path().join("config.toml"),
|
||||
..Config::default()
|
||||
};
|
||||
tokio::fs::create_dir_all(&config.workspace_dir).await.unwrap();
|
||||
tokio::fs::create_dir_all(&config.workspace_dir)
|
||||
.await
|
||||
.unwrap();
|
||||
Arc::new(config)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,9 @@ mod tests {
|
|||
config_path: tmp.path().join("config.toml"),
|
||||
..Config::default()
|
||||
};
|
||||
tokio::fs::create_dir_all(&config.workspace_dir).await.unwrap();
|
||||
tokio::fs::create_dir_all(&config.workspace_dir)
|
||||
.await
|
||||
.unwrap();
|
||||
Arc::new(config)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,9 @@ mod tests {
|
|||
config_path: tmp.path().join("config.toml"),
|
||||
..Config::default()
|
||||
};
|
||||
tokio::fs::create_dir_all(&config.workspace_dir).await.unwrap();
|
||||
tokio::fs::create_dir_all(&config.workspace_dir)
|
||||
.await
|
||||
.unwrap();
|
||||
Arc::new(config)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,9 @@ mod tests {
|
|||
config_path: tmp.path().join("config.toml"),
|
||||
..Config::default()
|
||||
};
|
||||
tokio::fs::create_dir_all(&config.workspace_dir).await.unwrap();
|
||||
tokio::fs::create_dir_all(&config.workspace_dir)
|
||||
.await
|
||||
.unwrap();
|
||||
Arc::new(config)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,7 +117,9 @@ mod tests {
|
|||
config_path: tmp.path().join("config.toml"),
|
||||
..Config::default()
|
||||
};
|
||||
tokio::fs::create_dir_all(&config.workspace_dir).await.unwrap();
|
||||
tokio::fs::create_dir_all(&config.workspace_dir)
|
||||
.await
|
||||
.unwrap();
|
||||
Arc::new(config)
|
||||
}
|
||||
|
||||
|
|
@ -156,7 +158,9 @@ mod tests {
|
|||
..Config::default()
|
||||
};
|
||||
config.autonomy.allowed_commands = vec!["echo".into()];
|
||||
tokio::fs::create_dir_all(&config.workspace_dir).await.unwrap();
|
||||
tokio::fs::create_dir_all(&config.workspace_dir)
|
||||
.await
|
||||
.unwrap();
|
||||
let cfg = Arc::new(config);
|
||||
let job = cron::add_job(&cfg, "*/5 * * * *", "echo ok").unwrap();
|
||||
let tool = CronUpdateTool::new(cfg.clone(), test_security(&cfg));
|
||||
|
|
|
|||
|
|
@ -375,7 +375,9 @@ mod tests {
|
|||
config_path: tmp.path().join("config.toml"),
|
||||
..Config::default()
|
||||
};
|
||||
tokio::fs::create_dir_all(&config.workspace_dir).await.unwrap();
|
||||
tokio::fs::create_dir_all(&config.workspace_dir)
|
||||
.await
|
||||
.unwrap();
|
||||
let security = Arc::new(SecurityPolicy::from_config(
|
||||
&config.autonomy,
|
||||
&config.workspace_dir,
|
||||
|
|
@ -489,7 +491,9 @@ mod tests {
|
|||
},
|
||||
..Config::default()
|
||||
};
|
||||
tokio::fs::create_dir_all(&config.workspace_dir).await.unwrap();
|
||||
tokio::fs::create_dir_all(&config.workspace_dir)
|
||||
.await
|
||||
.unwrap();
|
||||
let security = Arc::new(SecurityPolicy::from_config(
|
||||
&config.autonomy,
|
||||
&config.workspace_dir,
|
||||
|
|
|
|||
|
|
@ -363,7 +363,8 @@ mod tests {
|
|||
.unwrap();
|
||||
assert!(allowed.success);
|
||||
|
||||
let _ = tokio::fs::remove_file(std::env::temp_dir().join("zeroclaw_shell_approval_test")).await;
|
||||
let _ =
|
||||
tokio::fs::remove_file(std::env::temp_dir().join("zeroclaw_shell_approval_test")).await;
|
||||
}
|
||||
|
||||
// ── §5.2 Shell timeout enforcement tests ─────────────────
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue