Skip to content

Commit

Permalink
test: Update test for no script
Browse files Browse the repository at this point in the history
  • Loading branch information
bpetlert committed Dec 16, 2023
1 parent 632c5d5 commit 02fdc18
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,18 +391,18 @@ mod tests {

// No script for configuring state
let configuring_d = broker_root.join("configuring.d");
let result = ScriptBuilder::build_from(&configuring_d, Some(uid), Some(gid));
assert!(result.is_err());
let result = ScriptBuilder::build_from(&configuring_d, Some(uid), Some(gid)).unwrap();
assert!(result.is_empty());

// No script for root in degraded.d
let degraded_d = broker_root.join("degraded.d");
let result = ScriptBuilder::build_from(&degraded_d, None, None);
assert!(result.is_err());
let result = ScriptBuilder::build_from(&degraded_d, None, None).unwrap();
assert!(result.is_empty());

// No directory for routable state
let routable_d = broker_root.join("routable.d");
let result = ScriptBuilder::build_from(&routable_d, Some(uid), Some(gid));
assert!(result.is_err());
let result = ScriptBuilder::build_from(&routable_d, Some(uid), Some(gid)).unwrap();
assert!(result.is_empty());
}

fn setup_script_dir() -> tempfile::TempDir {
Expand Down

0 comments on commit 02fdc18

Please sign in to comment.