mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-04 21:12:57 -05:00
Tests: a headless agent session without folders also refuses a save
The test for a headless agent session with no usable agent folder now also saves to a path outside the agent folders, checks that the error names the missing write authority, and checks that no file was written.
This commit is contained in:
1 parent
53365705f5
commit
991925227b
1 file changed
+4
@@ -165,6 +165,10 @@ fn a_headless_agent_session_without_usable_folders_reads_and_writes_nothing() {
|
||||
std::fs::write(&outside, r#"<svg xmlns="http://www.w3.org/2000/svg" width="4" height="3"/>"#).unwrap();
|
||||
let e = b.call("app.open", json!({"path": outside.to_string_lossy()})).unwrap_err();
|
||||
assert!(e.contains("read authority is absent"), "{e}");
|
||||
let saved = dir.file("saved.svg");
|
||||
let e = b.call("app.save", json!({"path": saved.to_string_lossy()})).unwrap_err();
|
||||
assert!(e.contains("write authority is absent"), "{e}");
|
||||
assert!(!saved.exists(), "the refused save must not write the file");
|
||||
|
||||
// With Allow Agent Control off, the session is the ordinary headless fallback, as before.
|
||||
fn control_off(dir: &Path) -> AgentSettings {
|
||||
|
||||
Reference in new issue
Block a user