spark: add verification script for word count report
This commit is contained in:
1 parent
d81690d089
commit
ed0215370f
1 file changed
+26
@@ -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)
|
||||
Reference in new issue
Block a user