UXInteract / task_026 /tests /validate_outputs.py
DojiSum's picture
Publish the current 141-task UXInteract release
ef987bb verified
Raw History Blame Contribute Delete
669 Bytes
"""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'