Codex
Replace the dataset with the current testing tree and the three UT docs.
d26f22a
Raw History Blame Contribute Delete
1.1 kB
"""Read one ``cov_report/data/dashboard.js`` body.
Q001 passes the text it already has, from disk or from a git blob.
The dashboard summary format is not known yet, so every value stays unset.
"""
from __future__ import annotations
from dataclasses import dataclass
@dataclass(frozen=True)
class DashboardSummary:
"""Cumulative golden coverage from ``dashboard.js``.
``None`` means that number could not be read. It is not zero.
"""
stmt: float | None
cond: float | None
tgl: float | None
fsm: float | None
group: float | None
assert_attempted: int | None
assert_success: int | None
assert_failed: int | None
assert_vacuous: int | None
def read_dashboard(text: str) -> DashboardSummary:
"""Return stmt, cond, tgl, fsm, group, and assert counts from ``text``."""
if not isinstance(text, str):
raise TypeError("text must be a string")
return DashboardSummary(
stmt=None, cond=None, tgl=None, fsm=None, group=None,
assert_attempted=None, assert_success=None, assert_failed=None, assert_vacuous=None,
)