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

Function test_parse_post_tool_use_success

atomic-agent/src/hooks/agy.rs:548–563  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

546
547 #[test]
548 fn test_parse_post_tool_use_success() {
549 let hook = make_hook();
550 let input = br#"{
551 "conversationId": "ec33ebf9",
552 "transcriptPath": "/tmp/transcript.jsonl",
553 "workspacePaths": ["/workspace/project"],
554 "stepIdx": 5,
555 "error": ""
556 }"#;
557 let event = hook.parse_event(HookType::PostToolUse, input).unwrap();
558 assert_eq!(event.session_id, "ec33ebf9");
559 assert_eq!(event.event_type, HookType::PostToolUse);
560 assert_eq!(event.tool_use_id.as_deref(), Some("5"));
561 let raw = event.raw_json.unwrap();
562 assert_eq!(raw.get("status").and_then(Value::as_str), Some("completed"));
563 }
564
565 #[test]
566 fn test_parse_post_tool_use_error() {

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected