from tests.timer_contract_support import run_timer_contract, assert_current_build_contract from pathlib import Path ROOT = Path(__file__).resolve().parents[1] APP_JS = (ROOT / "ui_builder/static/app.js").read_text(encoding="utf-8") APP = (ROOT / "app.py").read_text(encoding="utf-8") def _block(start: str, end: str) -> str: return APP_JS.split(start, 1)[1].split(end, 1)[0] def test_space_pause_uses_suspend_not_stop_reset(): """Current native timer contract, executed against production functions.""" run_timer_contract('web_first') run_timer_contract('pause_freezes') def test_explicit_reset_set_path_keeps_stop_then_set(): """Current native timer contract, executed against production functions.""" run_timer_contract('explicit_edit') run_timer_contract('period_base') def test_penalty_normal_pause_uses_suspend(): """Current native timer contract, executed against production functions.""" run_timer_contract('penalty_pause') def test_build105_runtime_version(): assert_current_build_contract()