File size: 537 Bytes
ef987bb
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
"""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')