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:545–560  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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