Permalink
Browse files

Make sure headers and query parameters are sorted

Before, they would not have been sorted by the json module,
since they had already been put in a list before it sees them.
They would have been randomized once hash randomization kicks in in
a modern version of python, and they need to stay sorted so the
tests work.
  • Loading branch information...
1 parent 1f46484 commit 2825ec36303db9da2da9c6f198bf35386f22e455 Andrew Fleenor committed Nov 10, 2012
Showing with 14,372 additions and 13,764 deletions.
  1. +2 −2 har.py
  2. +357 −345 tests/fhs.pcap.har
  3. +333 −321 tests/fhs_ncomp.pcap.har
  4. +76 −76 tests/github.pcap.har
  5. +78 −78 tests/http.pcap.har
  6. +10,012 −9,554 tests/out-of-order.pcap.har
  7. +1,422 −1,366 tests/pcapr.net.pcap.har
  8. +2,092 −2,022 tests/sajal.pcap.har
View
4 har.py
@@ -11,14 +11,14 @@ def header_json_repr(d):
{
'name': k,
'value': v
- } for k, v in d.iteritems()
+ } for k, v in sorted(d.iteritems())
]
def query_json_repr(d):
# d = {string: [string]}
# we need to print all values of the list
output = []
- for k, l in d.iteritems():
+ for k, l in sorted(d.iteritems()):
for v in l:
output.append({
'name': k,
Oops, something went wrong.

0 comments on commit 2825ec3

Please sign in to comment.