()
| 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() { |
nothing calls this directly
no test coverage detected