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

Function test_policy_is_allowed

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

Source from the content-addressed store, hash-verified

224
225#[test]
226fn test_policy_is_allowed() {
227 let policy = PermissionPolicy::new().allow("Bash(cargo:*)");
228
229 assert!(policy.is_allowed("Bash", &json!({"command": "cargo build"})));
230 assert!(!policy.is_allowed("Bash", &json!({"command": "npm install"})));
231}
232
233#[test]
234fn test_policy_is_denied() {

Callers

nothing calls this directly

Calls 1

allowMethod · 0.80

Tested by

no test coverage detected