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

Function test_parse_post_tool

atomic-agent/src/hooks/copilot.rs:698–713  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

696
697 #[test]
698 fn test_parse_post_tool() {
699 let hook = make_hook();
700 let input = br#"{
701 "session_id": "s1",
702 "toolName": "bash",
703 "toolArgs": {"command": "ls -la"},
704 "tool_use_id": "call-99",
705 "toolResponse": {"exitCode": 0},
706 "duration": 1500
707 }"#;
708 let event = hook.parse_event(HookType::PostToolUse, input).unwrap();
709 assert_eq!(event.session_id, "s1");
710 assert_eq!(event.event_type, HookType::PostToolUse);
711 assert_eq!(event.tool_name.as_deref(), Some("bash"));
712 assert_eq!(event.tool_use_id.as_deref(), Some("call-99"));
713 }
714
715 #[test]
716 fn test_parse_post_tool_snake_case_fields() {

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected