aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-09-26 10:38:47 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-09-26 10:38:47 +1200
commita69d60208717db775ca68bbd1cd8a1af76082495 (patch)
tree2ebc4a62666079d61e2bb30616f5217460612cce /test
parent0a5d4fbbbb06a4e6c5e6172b353aa878aaa6e0c6 (diff)
downloadmitmproxy-a69d60208717db775ca68bbd1cd8a1af76082495.tar.gz
mitmproxy-a69d60208717db775ca68bbd1cd8a1af76082495.tar.bz2
mitmproxy-a69d60208717db775ca68bbd1cd8a1af76082495.zip
Hex and verbatim output of requests.
This works by sniffing traffic through the socket, so always gives us the exact traffic sent upstream.
Diffstat (limited to 'test')
-rw-r--r--test/test_pathoc.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/test_pathoc.py b/test/test_pathoc.py
index 8eb180af..9485f84d 100644
--- a/test/test_pathoc.py
+++ b/test/test_pathoc.py
@@ -49,11 +49,16 @@ class TestDaemon:
)
return s.getvalue()
- def test_print_requests(self):
+ def test_showresp(self):
reqs = [ "get:/api/info:p0,0", "get:/api/info:p0,0" ]
assert self.tval(reqs).count("200") == 2
assert self.tval(reqs, showresp=True).count("Date") == 2
+ def test_showreq(self):
+ reqs = [ "get:/api/info:p0,0", "get:/api/info:p0,0" ]
+ assert self.tval(reqs, showreq=True).count("unprintables escaped") == 2
+ assert self.tval(reqs, showreq=True, hexdump=True).count("hex dump") == 2
+
def test_parse_err(self):
assert "Error parsing" in self.tval(["foo"])