A function compare_json_data(source_data_a,source_data_b)
, accepting structures populated with data loaded from json.load()
and comparing for equality.
$ ./compare.py
Compare JSON result is: True
JSON files a.json
and b.json
are loaded via load_json()
function and structures passed into compare_json_data()
for comparison.
you might want to sort the lists before comparing them, and length of dictionaries could be compared as well