41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
"""Config 테스트."""
|
|
|
|
import pytest
|
|
|
|
from lazy_enter.config import Config
|
|
|
|
|
|
def test_config_defaults():
|
|
config = Config()
|
|
assert config.tmux_session_name == "claude"
|
|
assert config.codex_tmux_session_name == "codex"
|
|
assert config.pty_read_timeout == 5
|
|
assert config.output_buffer_interval == 2.0
|
|
assert config.output_settle_seconds == 4.0
|
|
assert config.output_flush_interval_seconds == 15.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()
|