From ed0215370f7f8aa30819d03f8d5e34e630331a27 Mon Sep 17 00:00:00 2001 From: spark Date: Fri, 23 Oct 2026 09:54:35 +0000 Subject: [PATCH] spark: add verification script for word count report --- wizard-work/spark/check_word_count_report.py | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 wizard-work/spark/check_word_count_report.py diff --git a/wizard-work/spark/check_word_count_report.py b/wizard-work/spark/check_word_count_report.py new file mode 100644 index 0000000..9cca2f7 --- /dev/null +++ b/wizard-work/spark/check_word_count_report.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +"""Verify the word count report JSON has expected structure and values.""" +import json +import sys + +def verify(): + report_path = "/root/troupe-standup/wizard-work/spark/word_count_report.json" + + with open(report_path) as f: + data = json.load(f) + + # Verify structure + assert data["files_processed"] == 5, f"Expected 5 files, got {data['files_processed']}" + assert data["total_words"] == 789, f"Expected 789 words, got {data['total_words']}" + assert len(data["files"]) == 5, f"Expected 5 file entries, got {len(data['files'])}" + + print("Verification passed") + return True + +if __name__ == "__main__": + try: + verify() + sys.exit(0) + except Exception as e: + print(f"Verification failed: {e}") + sys.exit(1) \ No newline at end of file