Merge pull request 'test(daemon): add default_agent_args unit tests for pi/zot harness' (#200) from feat/pi-autospawn-tests into main
Reviewed-on: #200
This commit is contained in:
commit
5578de0abb
1 changed files with 35 additions and 0 deletions
|
|
@ -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"]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue