diff --git a/tests/test_failcount.py b/tests/test_failcount.py new file mode 100644 index 00000000..f8c3ad7e --- /dev/null +++ b/tests/test_failcount.py @@ -0,0 +1,34 @@ +from datetime import datetime, timedelta, timezone +from pathlib import Path + +import pytest + +from scripts.tier2.failcount import ( + FailcountConfig, + FailcountState, + record_commit, + record_green_failure, + record_green_success, + record_red_failure, + should_give_up, + from_dict, + to_dict, + load_state, + save_state, +) + + +@pytest.fixture +def default_config() -> FailcountConfig: + return FailcountConfig() + + +@pytest.fixture +def fresh_state() -> FailcountState: + return FailcountState() + + +def test_initial_state_zero(fresh_state: FailcountState) -> None: + assert fresh_state.red_phase_failures == 0 + assert fresh_state.green_phase_failures == 0 + assert fresh_state.no_progress_started_at is None