MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_parse_pre_tool_use

Function test_parse_pre_tool_use

atomic-agent/src/hooks/claude_code/tests.rs:203–218  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

201
202 #[test]
203 fn test_parse_pre_tool_use() {
204 let hook = make_hook();
205 let input = br#"{
206 "session_id": "sess-7",
207 "transcript_path": "/t.jsonl",
208 "tool_use_id": "tu-001",
209 "tool_input": {"description": "run tests"}
210 }"#;
211 let event = hook.parse_event(HookType::PreToolUse, input).unwrap();
212
213 assert_eq!(event.session_id, "sess-7");
214 assert_eq!(event.event_type, HookType::PreToolUse);
215 assert_eq!(event.tool_use_id, Some("tu-001".to_string()));
216 // tool_name is not set from JSON input for PreToolUse (comes from matcher context)
217 assert!(event.tool_name.is_none());
218 }
219
220 #[test]
221 fn test_parse_pre_tool_use_minimal() {

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected