Merge remote-tracking branch 'origin/main' into fix/slack-ansi-filter
# Conflicts: # src/lazy_enter/bridge.py
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
"""Config 테스트."""
|
||||
|
||||
import pytest
|
||||
|
||||
from lazy_enter.config import Config
|
||||
|
||||
|
||||
@@ -9,3 +11,27 @@ def test_config_defaults():
|
||||
assert config.pty_read_timeout == 5
|
||||
assert config.output_buffer_interval == 2.0
|
||||
assert config.max_message_length == 3000
|
||||
assert config.reconnect_delay_seconds == 5.0
|
||||
assert config.output_idle_report_seconds == 120
|
||||
assert config.input_idle_report_seconds == 300
|
||||
|
||||
|
||||
def test_validate_required_settings_missing() -> None:
|
||||
config = Config()
|
||||
config.slack_bot_token = ""
|
||||
config.slack_app_token = ""
|
||||
config.allowed_user_id = ""
|
||||
config.allowed_channel_id = ""
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
config.validate_required_settings()
|
||||
|
||||
|
||||
def test_validate_required_settings_ok() -> None:
|
||||
config = Config()
|
||||
config.slack_bot_token = "xoxb-test"
|
||||
config.slack_app_token = "xapp-test"
|
||||
config.allowed_user_id = "U000"
|
||||
config.allowed_channel_id = "C000"
|
||||
|
||||
config.validate_required_settings()
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
"""PtyManager 테스트."""
|
||||
|
||||
import pytest
|
||||
|
||||
from lazy_enter.pty_manager import PtyManager
|
||||
|
||||
|
||||
@@ -10,7 +12,11 @@ def test_initial_state():
|
||||
|
||||
def test_start_and_stop():
|
||||
pty = PtyManager("cat")
|
||||
pty.start()
|
||||
try:
|
||||
pty.start()
|
||||
except OSError as exc:
|
||||
pytest.skip(f"PTY unavailable in this environment: {exc}")
|
||||
|
||||
assert pty.is_alive
|
||||
pty.stop()
|
||||
assert not pty.is_alive
|
||||
|
||||
Reference in New Issue
Block a user