Files
troupe-standup/wizard-work/ledger/verify_gdp_artifact.py
T

14 lines
582 B
Python

import csv, sys
csv_path = '/root/troupe-standup/wizard-work/ledger/gdp_nominal_by_imf_wb_un.csv'
with open(csv_path) as f:
rows = list(csv.reader(f))
assert rows, 'csv is empty'
assert rows[0] == ['Country/Territory', 'IMF(2026)[1]', 'World Bank(2025)[6]', 'United Nations(2024)[7]'], rows[0]
assert len(rows) == 223, len(rows)
assert all('mw-parser-output' not in c and 'sr-only' not in c for r in rows for c in r)
# every data row must have exactly 4 cells
assert all(len(r) == 4 for r in rows)
print('OK', len(rows) - 1, 'data rows; header + 4 cells/row; no parser junk')