From 388fa7e716aa634f841059f50a731c38c71dd36f Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Fri, 16 Dec 2016 00:13:18 +0100 Subject: remove intercept events, update view manually --- test/mitmproxy/test_flow.py | 10 ++++------ test/mitmproxy/test_web_app.py | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/mitmproxy/test_flow.py b/test/mitmproxy/test_flow.py index c297e8f9..2256a7aa 100644 --- a/test/mitmproxy/test_flow.py +++ b/test/mitmproxy/test_flow.py @@ -1,5 +1,4 @@ from mitmproxy.test import tflow -import mock import io from mitmproxy.test import tutils @@ -97,21 +96,20 @@ class TestHTTPFlow: assert f.get_state() == f2.get_state() def test_kill(self): - fm = mock.Mock() f = tflow.tflow() f.reply.handle() - f.intercept(fm) + f.intercept() assert f.killable - f.kill(fm) + f.kill() assert not f.killable assert f.reply.value == Kill def test_resume(self): f = tflow.tflow() f.reply.handle() - f.intercept(mock.Mock()) + f.intercept() assert f.reply.state == "taken" - f.resume(mock.Mock()) + f.resume() assert f.reply.state == "committed" def test_replace_unicode(self): diff --git a/test/mitmproxy/test_web_app.py b/test/mitmproxy/test_web_app.py index 1fb5ccf0..6cf6ce26 100644 --- a/test/mitmproxy/test_web_app.py +++ b/test/mitmproxy/test_web_app.py @@ -83,7 +83,7 @@ class TestApp(tornado.testing.AsyncHTTPTestCase): def test_resume(self): for f in self.view: f.reply.handle() - f.intercept(self.master) + f.intercept() assert self.fetch( "/flows/42/resume", method="POST").code == 200 @@ -95,7 +95,7 @@ class TestApp(tornado.testing.AsyncHTTPTestCase): for f in self.view: f.backup() f.reply.handle() - f.intercept(self.master) + f.intercept() assert self.fetch("/flows/42/kill", method="POST").code == 200 assert sum(f.killable for f in self.view) == 1 -- cgit v1.2.3