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

Function test_parse_task_start

atomic-agent/src/hooks/cline.rs:583–600  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

581
582 #[test]
583 fn test_parse_task_start() {
584 let hook = make_hook();
585 let input = br#"{
586 "taskId": "abc123",
587 "hookName": "TaskStart",
588 "timestamp": "1736654400000",
589 "workspaceRoots": ["/path/to/project"],
590 "model": {"provider": "openrouter", "slug": "anthropic/claude-sonnet-4.5"},
591 "taskStart": {"task": "Add authentication to the API"}
592 }"#;
593 let event = hook.parse_event(HookType::SessionStart, input).unwrap();
594 assert_eq!(event.session_id, "abc123");
595 assert_eq!(event.event_type, HookType::SessionStart);
596 assert_eq!(
597 event.prompt.as_deref(),
598 Some("Add authentication to the API")
599 );
600 }
601
602 #[test]
603 fn test_parse_task_start_with_model_info() {

Callers

nothing calls this directly

Calls 3

make_hookFunction · 0.70
unwrapMethod · 0.45
parse_eventMethod · 0.45

Tested by

no test coverage detected