From a69d60208717db775ca68bbd1cd8a1af76082495 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Wed, 26 Sep 2012 10:38:47 +1200 Subject: Hex and verbatim output of requests. This works by sniffing traffic through the socket, so always gives us the exact traffic sent upstream. --- test/test_pathoc.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test') 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"]) -- cgit v1.2.3