Let's sort the keys so that this test passes even with random hashes.

This commit is contained in:
Barry Warsaw 2012-02-21 10:22:34 -05:00
parent b19fb2462e
commit b69fa1f8b7

View file

@ -29,7 +29,7 @@ Encoding basic Python object hierarchies::
Compact encoding::
>>> import json
>>> json.dumps([1,2,3,{'4': 5, '6': 7}], separators=(',',':'))
>>> json.dumps([1,2,3,{'4': 5, '6': 7}], sort_keys=True, separators=(',',':'))
'[1,2,3,{"4":5,"6":7}]'
Pretty printing (using repr() because of extraneous whitespace in the output)::