aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-08-31 17:05:52 +0200
committerMaximilian Hils <git@maximilianhils.com>2015-08-31 17:05:52 +0200
commitb04e6e56ab1e69853abebfb950539e3a3aefbdf2 (patch)
treec1907cda3384aee854dbeb5132bed029ae26e595 /test
parent41e6e538dfa758b7d9f867f85f62e881ae408684 (diff)
downloadmitmproxy-b04e6e56ab1e69853abebfb950539e3a3aefbdf2.tar.gz
mitmproxy-b04e6e56ab1e69853abebfb950539e3a3aefbdf2.tar.bz2
mitmproxy-b04e6e56ab1e69853abebfb950539e3a3aefbdf2.zip
update inline script hooks
Diffstat (limited to 'test')
-rw-r--r--test/test_proxy.py7
-rw-r--r--test/test_server.py4
2 files changed, 7 insertions, 4 deletions
diff --git a/test/test_proxy.py b/test/test_proxy.py
index b9ca2cce..cc6a79d0 100644
--- a/test/test_proxy.py
+++ b/test/test_proxy.py
@@ -172,11 +172,16 @@ class TestConnectionHandler:
root_layer = mock.Mock()
root_layer.side_effect = RuntimeError
config.mode.return_value = root_layer
+ channel = mock.Mock()
+
+ def ask(_, x):
+ return x
+ channel.ask = ask
c = ConnectionHandler(
mock.MagicMock(),
("127.0.0.1", 8080),
config,
- mock.MagicMock()
+ channel
)
with tutils.capture_stderr(c.handle) as output:
assert "mitmproxy has crashed" in output
diff --git a/test/test_server.py b/test/test_server.py
index 23d802ca..a1259b7f 100644
--- a/test/test_server.py
+++ b/test/test_server.py
@@ -611,13 +611,11 @@ class MasterRedirectRequest(tservers.TestMaster):
def handle_request(self, f):
if f.request.path == "/p/201":
- # This part should have no impact, but it should not cause any exceptions.
+ # This part should have no impact, but it should also not cause any exceptions.
addr = f.live.server_conn.address
addr2 = Address(("127.0.0.1", self.redirect_port))
f.live.set_server(addr2)
- f.live.connect()
f.live.set_server(addr)
- f.live.connect()
# This is the actual redirection.
f.request.port = self.redirect_port