Implement reconnect, idle reporting, and security hardening
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()
|
||||
|
||||
Reference in New Issue
Block a user