test: add approval requirements fallback regression coverage

This commit is contained in:
daniel-oai
2026-02-13 14:37:08 -08:00
parent 6c0a924203
commit d3abfcf116
3 changed files with 204 additions and 0 deletions
@@ -885,6 +885,22 @@ mod tests {
Ok(())
}
#[test]
fn empty_allowed_approval_policies_is_rejected() -> Result<()> {
let toml_str = r#"
allowed_approval_policies = []
"#;
let config: ConfigRequirementsToml = from_str(toml_str)?;
let err = ConfigRequirements::try_from(with_unknown_source(config))
.expect_err("empty allowlist should be rejected");
assert_eq!(
err,
ConstraintError::empty_field("allowed_approval_policies")
);
Ok(())
}
#[test]
fn deserialize_allowed_sandbox_modes() -> Result<()> {
let toml_str = r#"