test(daemon): add default_agent_args unit tests for pi/zot harness #200

Merged
clawdie merged 1 commit from feat/pi-autospawn-tests into main 2026-06-25 23:52:53 +02:00

View file

@ -1360,4 +1360,39 @@ mod tests {
assert!(path.exists(), "live socket must not be removed");
let _ = std::fs::remove_dir_all(&dir);
}
#[test]
fn default_agent_args_zot_gets_rpc() {
assert_eq!(super::default_agent_args("zot"), vec!["rpc"]);
assert_eq!(
super::default_agent_args("/usr/local/bin/zot"),
vec!["rpc"],
"basename extraction must work for path-prefixed zot"
);
}
#[test]
fn default_agent_args_pi_gets_mode_json() {
assert_eq!(super::default_agent_args("pi"), vec!["--mode", "json"]);
assert_eq!(
super::default_agent_args("/usr/local/bin/pi"),
vec!["--mode", "json"],
"basename extraction must work for path-prefixed pi"
);
}
#[test]
fn default_agent_args_unknown_gets_mode_json() {
// Any binary that isn't zot gets the self-driving JSON mode.
// This is the safe default — unknown harnesses are assumed to be
// pi-compatible (--mode json), not zot-compatible (rpc).
assert_eq!(
super::default_agent_args("sample-pi-agent.py"),
vec!["--mode", "json"]
);
assert_eq!(
super::default_agent_args("colibri-test-agent"),
vec!["--mode", "json"]
);
}
}