diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2014-11-06 10:35:00 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2014-11-06 10:35:00 +1300 |
commit | 0fe83ce87bd1e3cf00fb06d2cc06e1bf3b0dbe85 (patch) | |
tree | 07dc49ceceb8de9e3c160300e20de935bc475939 /test | |
parent | e732771c1ca354ef7b895da4088e727573476e34 (diff) | |
download | mitmproxy-0fe83ce87bd1e3cf00fb06d2cc06e1bf3b0dbe85.tar.gz mitmproxy-0fe83ce87bd1e3cf00fb06d2cc06e1bf3b0dbe85.tar.bz2 mitmproxy-0fe83ce87bd1e3cf00fb06d2cc06e1bf3b0dbe85.zip |
Fix bug in flow dumping, add unit test that should have caught this in the first place
Diffstat (limited to 'test')
-rw-r--r-- | test/test_dump.py | 16 |
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() |