diff options
| author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-08-01 10:40:19 +0200 | 
|---|---|---|
| committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-08-01 14:37:32 +0200 | 
| commit | db02553e2afee044faac898d12bd8d1adadbcd21 (patch) | |
| tree | 1e5910599b7b47c527528f03f896efd2fbf7c907 /test/test_dump.py | |
| parent | 8a051511706e2e62c32e0f70e05ecab11d444b6f (diff) | |
| download | mitmproxy-db02553e2afee044faac898d12bd8d1adadbcd21.tar.gz mitmproxy-db02553e2afee044faac898d12bd8d1adadbcd21.tar.bz2 mitmproxy-db02553e2afee044faac898d12bd8d1adadbcd21.zip | |
move code from mitmproxy to netlib
Diffstat (limited to 'test/test_dump.py')
| -rw-r--r-- | test/test_dump.py | 11 | 
1 files changed, 6 insertions, 5 deletions
| diff --git a/test/test_dump.py b/test/test_dump.py index 46c832d3..b3d724a5 100644 --- a/test/test_dump.py +++ b/test/test_dump.py @@ -1,17 +1,18 @@  import os  from cStringIO import StringIO +import netlib.tutils  from netlib.http.semantics import CONTENT_MISSING  from libmproxy import dump, flow -from libmproxy.protocol import http +from libmproxy.protocol import http, http_wrappers  from libmproxy.proxy.primitives import Log  import tutils  import mock  def test_strfuncs(): -    t = tutils.tresp() +    t = http_wrappers.HTTPResponse.wrap(netlib.tutils.tresp())      t.is_replay = True      dump.str_response(t) @@ -26,14 +27,14 @@ def test_strfuncs():  class TestDumpMaster:      def _cycle(self, m, content): -        f = tutils.tflow(req=tutils.treq(content)) +        f = tutils.tflow(req=netlib.tutils.treq(content))          l = Log("connect")          l.reply = mock.MagicMock()          m.handle_log(l)          m.handle_clientconnect(f.client_conn)          m.handle_serverconnect(f.server_conn)          m.handle_request(f) -        f.response = tutils.tresp(content) +        f.response = http_wrappers.HTTPResponse.wrap(netlib.tutils.tresp(content))          f = m.handle_response(f)          m.handle_clientdisconnect(f.client_conn)          return f @@ -70,7 +71,7 @@ class TestDumpMaster:          f = tutils.tflow()          f.request.content = CONTENT_MISSING          m.handle_request(f) -        f.response = tutils.tresp() +        f.response = http_wrappers.HTTPResponse.wrap(netlib.tutils.tresp())          f.response.content = CONTENT_MISSING          m.handle_response(f)          assert "content missing" in cs.getvalue() | 
