Add contributor guide and project usage docs

This commit is contained in:
2026-02-16 22:48:05 +09:00
parent 1e552f8c46
commit 87482efd6d
16 changed files with 671 additions and 1 deletions

34
tests/test_hooks.py Normal file
View File

@@ -0,0 +1,34 @@
"""hooks 모듈 테스트."""
from lazy_enter.hooks import format_notification, parse_hook_event
def test_parse_hook_event_valid():
raw = '{"type": "prompt", "tool": "Bash"}'
event = parse_hook_event(raw)
assert event["type"] == "prompt"
assert event["tool"] == "Bash"
def test_parse_hook_event_invalid():
event = parse_hook_event("not json")
assert event == {}
def test_format_notification_prompt():
event = {"type": "prompt", "tool": "Bash"}
msg = format_notification(event)
assert msg is not None
assert "승인 대기 중" in msg
def test_format_notification_completion():
event = {"type": "completion", "summary": "리팩토링 완료"}
msg = format_notification(event)
assert msg is not None
assert "완료" in msg
def test_format_notification_unknown():
event = {"type": "unknown"}
assert format_notification(event) is None