Files
troupe-standup/wizard-work/spark/validate_json_match.py
T

19 lines
469 B
Python

#!/usr/bin/env python3
import json
import sys
try:
with open('/root/.hermes/wizard-outputs/spark/actual_output.json') as f:
a = json.load(f)
with open('/root/.hermes/wizard-outputs/spark/word_freq_output.json') as f:
b = json.load(f)
if a == b:
print("MATCH: Output validates correctly")
sys.exit(0)
else:
print("MISMATCH")
sys.exit(1)
except Exception as e:
print(f"ERROR: {e}")
sys.exit(1)