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

Source from the content-addressed store, hash-verified

1406
1407 #[test]
1408 fn test_parse_post_tool_use_success() {
1409 let hook = make_hook();
1410 let input = br#"{
1411 "conversationId": "ec33ebf9",
1412 "transcriptPath": "/tmp/transcript.jsonl",
1413 "workspacePaths": ["/workspace/project"],
1414 "stepIdx": 5,
1415 "error": ""
1416 }"#;
1417 let event = hook.parse_event(HookType::PostToolUse, input).unwrap();
1418 assert_eq!(event.session_id, "ec33ebf9");
1419 assert_eq!(event.event_type, HookType::PostToolUse);
1420 assert_eq!(event.tool_use_id.as_deref(), Some("5"));
1421 let raw = event.raw_json.unwrap();
1422 assert_eq!(raw.get("status").and_then(Value::as_str), Some("completed"));
1423 }
1424
1425 #[test]
1426 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