File size: 669 Bytes
ef987bb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | """Validate output presence and per-record half-up rounding without rerunning helpers."""
import csv
import math
from pathlib import Path
for name in ('boston_clean.csv', 'titanic_clean.csv', 'report.html'):
assert Path(name).is_file() and Path(name).stat().st_size, f'missing {name}'
with Path('boston_clean.csv').open(encoding='utf-8-sig', newline='') as source:
rows = list(csv.DictReader(source))
assert rows, 'empty Boston output'
for row in rows:
assert float(row['rm_rounded']) == math.floor(float(row['rm']) + .5), 'incorrect half-up room rounding'
assert Path('/logs/verifier/candidate.log').read_text().strip(), 'missing processing progress log'
|