test(signal_v2): add scheduler boundary tests at exact transitions
Code review noted missing boundary tests at: - 09:00:00 (pre-market → market) → 60 - 15:30:00 (market → post-market) → 300 - 20:00:00 (post-market → overnight skip) 3 new tests, total 8 scheduler / 14 signal_v2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -39,3 +39,23 @@ def test_next_interval_holiday_skip():
|
||||
interval = _next_interval(now)
|
||||
# Next: 2026-05-06 (Wed) 07:00, ~21h away
|
||||
assert 20 * 3600 < interval < 22 * 3600
|
||||
|
||||
|
||||
def test_next_interval_at_market_open_boundary():
|
||||
"""09:00:00 정확 second → 60초 (market 구간 진입)."""
|
||||
now = _kst(2026, 5, 18, 9, 0) # Monday 09:00:00
|
||||
assert _next_interval(now) == 60
|
||||
|
||||
|
||||
def test_next_interval_at_market_close_boundary():
|
||||
"""15:30:00 정확 second → 300초 (post-market 구간 진입)."""
|
||||
now = _kst(2026, 5, 18, 15, 30) # Monday 15:30:00
|
||||
assert _next_interval(now) == 300
|
||||
|
||||
|
||||
def test_next_interval_at_polling_window_end_boundary():
|
||||
"""20:00:00 정확 second → overnight skip (다음 영업일 07:00 까지)."""
|
||||
now = _kst(2026, 5, 18, 20, 0) # Monday 20:00:00
|
||||
interval = _next_interval(now)
|
||||
# Next: Tuesday 07:00 — 11h away
|
||||
assert 11 * 3600 - 60 < interval < 11 * 3600 + 60
|
||||
|
||||
Reference in New Issue
Block a user