aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_dump.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_dump.py')
-rw-r--r--test/test_dump.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/test_dump.py b/test/test_dump.py
index 2e58e073..e9cb4d33 100644
--- a/test/test_dump.py
+++ b/test/test_dump.py
@@ -1,10 +1,12 @@
import os
from cStringIO import StringIO
-from libmproxy import dump, flow, proxy
+from libmproxy import dump, flow
+from libmproxy.protocol import http
from libmproxy.proxy.primitives import Log
import tutils
import mock
+
def test_strfuncs():
t = tutils.tresp()
t.is_replay = True
@@ -58,6 +60,18 @@ class TestDumpMaster:
assert m.handle_error(f)
assert "error" in cs.getvalue()
+ def test_missing_content(self):
+ cs = StringIO()
+ o = dump.Options(flow_detail=3)
+ m = dump.DumpMaster(None, o, outfile=cs)
+ f = tutils.tflow()
+ f.request.content = http.CONTENT_MISSING
+ m.handle_request(f)
+ f.response = tutils.tresp()
+ f.response.content = http.CONTENT_MISSING
+ m.handle_response(f)
+ assert "content missing" in cs.getvalue()
+
def test_replay(self):
cs = StringIO()