diff options
author | Aldo Cortesi <aldo@corte.si> | 2016-12-17 09:15:11 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-17 09:15:11 +1300 |
commit | cf15a3c3ef7806ee6d6fc0e01bc20c3c51070dbf (patch) | |
tree | d4f9c61b39a4ef568bab10c70971c466afaa7940 /test | |
parent | 6695ce462405b8691a0cc4d8110f67f2bd871bc5 (diff) | |
parent | 388fa7e716aa634f841059f50a731c38c71dd36f (diff) | |
download | mitmproxy-cf15a3c3ef7806ee6d6fc0e01bc20c3c51070dbf.tar.gz mitmproxy-cf15a3c3ef7806ee6d6fc0e01bc20c3c51070dbf.tar.bz2 mitmproxy-cf15a3c3ef7806ee6d6fc0e01bc20c3c51070dbf.zip |
Merge pull request #1862 from mhils/remove-intercept-events
Remove intercept events, update view manually
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/test_flow.py | 10 | ||||
-rw-r--r-- | test/mitmproxy/test_web_app.py | 4 |
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 |