aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-12-16 00:13:18 +0100
committerMaximilian Hils <git@maximilianhils.com>2016-12-16 05:43:38 +0100
commit388fa7e716aa634f841059f50a731c38c71dd36f (patch)
treecfac4930c89934a8a9b50d421e2d57c78b09eaee /test
parent6b5673e84911f3e2b1599c22c9b4f482a55b9ef1 (diff)
downloadmitmproxy-388fa7e716aa634f841059f50a731c38c71dd36f.tar.gz
mitmproxy-388fa7e716aa634f841059f50a731c38c71dd36f.tar.bz2
mitmproxy-388fa7e716aa634f841059f50a731c38c71dd36f.zip
remove intercept events, update view manually
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/test_flow.py10
-rw-r--r--test/mitmproxy/test_web_app.py4
2 files changed, 6 insertions, 8 deletions
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