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

Function test_policy_allow_all

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

Source from the content-addressed store, hash-verified

263
264#[test]
265fn test_policy_allow_all() {
266 let policy = PermissionPolicy::new().allow_all(&["Bash(cargo:*)", "Bash(npm:*)", "Grep(*)"]);
267
268 assert_eq!(policy.allow.len(), 3);
269 assert!(policy.is_allowed("Bash", &json!({"command": "cargo build"})));
270 assert!(policy.is_allowed("Bash", &json!({"command": "npm run test"})));
271 assert!(policy.is_allowed("Grep", &json!({"pattern": "foo"})));
272}
273
274// ========================================================================
275// PermissionRule Deserialization Tests

Callers

nothing calls this directly

Calls 1

allow_allMethod · 0.80

Tested by

no test coverage detected