MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_policy_requires_confirmation

Function test_policy_requires_confirmation

core/src/permissions/tests.rs:242–249  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

240
241#[test]
242fn test_policy_requires_confirmation() {
243 // Create a policy that explicitly allows Read but asks for Write
244 let mut policy = PermissionPolicy::new().allow("Read(*)").ask("Write(*)");
245 policy.default_decision = PermissionDecision::Deny; // Make default deny to test ask rule
246
247 assert!(policy.requires_confirmation("Write", &json!({"file_path": "/tmp/test"})));
248 assert!(!policy.requires_confirmation("Read", &json!({"file_path": "/tmp/test"})));
249}
250
251#[test]
252fn test_policy_matching_rules() {

Callers

nothing calls this directly

Calls 2

askMethod · 0.80
allowMethod · 0.80

Tested by

no test coverage detected