UXInteract / task_027 /tests /validate_outputs.py
DojiSum's picture
Publish the current 141-task UXInteract release
ef987bb verified
Raw History Blame Contribute Delete
537 Bytes
"""Output presence/CSV readability only; semantic checks live in dedicated modules."""
import csv
from pathlib import Path
for name in ('cut_price_stats.csv','price_bin_stats.csv','top_10_diamonds.csv','report.html'):
path=Path(name)
assert path.is_file() and path.stat().st_size>0, f'missing output {name}'
if path.suffix=='.csv':
with path.open(encoding='utf-8-sig',newline='') as source:
assert list(csv.DictReader(source)), f'empty CSV {name}'
print('Output files exist and CSV tables are readable')