35 lines
689 B
Python
35 lines
689 B
Python
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
|