Skip to content

Commit

Permalink
Merge pull request #39 from underdogio/dev/add.json.indent.sqwished
Browse files Browse the repository at this point in the history
Added indent to JsonEncoder
  • Loading branch information
charlax committed Jun 6, 2015
2 parents 255d97d + 6096671 commit c59a6d5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
{"status": 200, "raw_headers": ["Server: nginx\r\n", "Date: Thu, 12 Mar 2015 18:43:47 GMT\r\n", "Content-Type: application/json\r\n", "Content-Length: 205\r\n", "Connection: close\r\n", "Access-Control-Allow-Origin: *\r\n", "Access-Control-Allow-Credentials: true\r\n"], "content": "{\n \"args\": {}, \n \"headers\": {\n \"Accept-Encoding\": \"identity\", \n \"Host\": \"httpbin.org\", \n \"User-Agent\": \"Python-urllib/2.7\"\n }, \n \"origin\": \"8.26.157.128\", \n \"url\": \"http://httpbin.org/get\"\n}\n", "headers": {"content-length": "205", "server": "nginx", "connection": "close", "access-control-allow-credentials": "true", "date": "Thu, 12 Mar 2015 18:43:47 GMT", "access-control-allow-origin": "*", "content-type": "application/json"}, "reason": "OK", "version": 11, "length": 0}
{
"status": 200,
"raw_headers": [
"Server: nginx\r\n",
"Date: Sat, 06 Jun 2015 00:30:37 GMT\r\n",
"Content-Type: application/json\r\n",
"Content-Length: 207\r\n",
"Connection: close\r\n",
"Access-Control-Allow-Origin: *\r\n",
"Access-Control-Allow-Credentials: true\r\n"
],
"content": "{\n \"args\": {}, \n \"headers\": {\n \"Accept-Encoding\": \"identity\", \n \"Host\": \"httpbin.org\", \n \"User-Agent\": \"Python-urllib/2.7\"\n }, \n \"origin\": \"67.165.177.180\", \n \"url\": \"http://httpbin.org/get\"\n}\n",
"headers": {
"content-length": "207",
"server": "nginx",
"connection": "close",
"access-control-allow-credentials": "true",
"date": "Sat, 06 Jun 2015 00:30:37 GMT",
"access-control-allow-origin": "*",
"content-type": "application/json"
},
"reason": "OK",
"version": 11,
"length": 0
}
2 changes: 1 addition & 1 deletion cassette/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class JsonEncoder(Encoder):

def dump(self, data):
"""Return a YAML encoded string of the data."""
return json.dumps(data, ensure_ascii=False)
return json.dumps(data, indent=4, ensure_ascii=False)

def load(self, encoded_str):
"""Return an object from the encoded JSON string."""
Expand Down

0 comments on commit c59a6d5

Please sign in to comment.