mirror of
https://github.com/openai/codex.git
synced 2026-11-13 21:30:47 +00:00
test: add approval requirements fallback regression coverage
This commit is contained in:
@@ -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#"
|
||||
|
||||
Reference in New Issue
Block a user