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

0
tests/__init__.py Normal file
View File

11
tests/test_config.py Normal file
View File

@@ -0,0 +1,11 @@
"""Config 테스트."""
from lazy_enter.config import Config
def test_config_defaults():
config = Config()
assert config.default_shell == "claude"
assert config.pty_read_timeout == 5
assert config.output_buffer_interval == 2.0
assert config.max_message_length == 3000

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

16
tests/test_pty_manager.py Normal file
View File

@@ -0,0 +1,16 @@
"""PtyManager 테스트."""
from lazy_enter.pty_manager import PtyManager
def test_initial_state():
pty = PtyManager("echo hello")
assert not pty.is_alive
def test_start_and_stop():
pty = PtyManager("cat")
pty.start()
assert pty.is_alive
pty.stop()
assert not pty.is_alive