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

Function test_parse_session_end

atomic-agent/src/hooks/codex.rs:1029–1049  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1027
1028 #[test]
1029 fn test_parse_session_end() {
1030 let input = br#"{
1031 "session_id": "sess-123",
1032 "transcript_path": "/tmp/codex.jsonl",
1033 "cwd": "/repo",
1034 "hook_event_name": "SessionEnd",
1035 "reason": "other"
1036 }"#;
1037 let event = make_hook()
1038 .parse_event(HookType::SessionEnd, input)
1039 .unwrap();
1040 assert_eq!(event.session_id, "sess-123");
1041 assert_eq!(event.event_type, HookType::SessionEnd);
1042 assert_eq!(
1043 event.transcript_path.as_deref(),
1044 Some(Path::new("/tmp/codex.jsonl"))
1045 );
1046 let raw = event.raw_json.unwrap();
1047 assert_eq!(raw["reason"], "other");
1048 assert_eq!(raw["provider"], "openai");
1049 }
1050
1051 #[test]
1052 fn test_parse_event_empty_input() {

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected