"""watch_ops 단위 테스트.""" from __future__ import annotations from datetime import datetime, timedelta from bithumb.operations.watch_ops import WatchIssue, WatchReport, remediate_ops_watch class _FakeSettings: ops_mode = "live" ops_telegram_enabled = False telegram_bot_token = "" telegram_chat_id = "" ops_watch_auto_remediate = True ops_watch_auto_restart = False ops_tick_lock_path = None ops_loop_pid_file = None def test_remediate_dry_run_no_actions() -> None: """dry-run은 tick/재시작 없음.""" report = WatchReport( checked_at=datetime.now().strftime("%Y-%m-%d %H:%M:%S"), issues=[ WatchIssue( kind="miss_pending", severity="critical", message="test", ) ], ) result = remediate_ops_watch(_FakeSettings(), report, dry_run=True) assert "dry_run" in result.actions assert result.tick_report is None def test_remediate_ok_when_no_issues() -> None: """이슈 없으면 조치 없음.""" report = WatchReport(checked_at="2026-06-14 20:00:00") result = remediate_ops_watch(_FakeSettings(), report, dry_run=False) assert result.actions == []