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

Function test_parse_before_tool

atomic-agent/src/hooks/pi.rs:730–742  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

728
729 #[test]
730 fn test_parse_before_tool() {
731 let hook = make_hook();
732 let input = br#"{
733 "session_id": "s1",
734 "tool_name": "edit",
735 "tool_call_id": "call-42",
736 "tool_input": {"file": "main.rs"}
737 }"#;
738 let event = hook.parse_event(HookType::PreToolUse, input).unwrap();
739 assert_eq!(event.session_id, "s1");
740 assert_eq!(event.tool_name.as_deref(), Some("edit"));
741 assert_eq!(event.tool_use_id.as_deref(), Some("call-42"));
742 }
743
744 #[test]
745 fn test_parse_before_tool_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