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

Function test_policy_disabled

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

Source from the content-addressed store, hash-verified

214
215#[test]
216fn test_policy_disabled() {
217 let mut policy = PermissionPolicy::new().deny("Bash(rm:*)").ask("Bash(*)");
218 policy.enabled = false;
219
220 // When disabled, everything is allowed
221 let decision = policy.check("Bash", &json!({"command": "rm -rf /"}));
222 assert_eq!(decision, PermissionDecision::Allow);
223}
224
225#[test]
226fn test_policy_is_allowed() {

Callers

nothing calls this directly

Calls 3

askMethod · 0.80
denyMethod · 0.80
checkMethod · 0.45

Tested by

no test coverage detected