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

Function test_map_pre_tool_use

core/src/ahp/executor_tests.rs:289–304  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

287
288#[test]
289fn test_map_pre_tool_use() {
290 let executor = make_test_executor();
291
292 let event = HookEvent::PreToolUse(PreToolUseEvent {
293 session_id: "session-123".to_string(),
294 tool: "Bash".to_string(),
295 args: serde_json::json!({"command": "ls"}),
296 working_directory: "/workspace".to_string(),
297 recent_tools: vec![],
298 });
299
300 let ahp_event = executor.map_event(&event).unwrap();
301 assert_eq!(ahp_event.event_type, EventType::PreAction);
302 assert_eq!(ahp_event.session_id, "session-123");
303 assert_eq!(ahp_event.depth, 0);
304}
305
306#[test]
307fn test_map_decision_allow() {

Callers

nothing calls this directly

Calls 2

make_test_executorFunction · 0.85
map_eventMethod · 0.80

Tested by

no test coverage detected