diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/test_web_app.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/test/mitmproxy/test_web_app.py b/test/mitmproxy/test_web_app.py index 2cab5bf4..1fb5ccf0 100644 --- a/test/mitmproxy/test_web_app.py +++ b/test/mitmproxy/test_web_app.py @@ -80,17 +80,30 @@ class TestApp(tornado.testing.AsyncHTTPTestCase): self.view.add(f) self.events.data = events - def test_accept(self): + def test_resume(self): for f in self.view: f.reply.handle() f.intercept(self.master) assert self.fetch( - "/flows/42/accept", method="POST").code == 200 + "/flows/42/resume", method="POST").code == 200 assert sum(f.intercepted for f in self.view) == 1 - assert self.fetch("/flows/accept", method="POST").code == 200 + assert self.fetch("/flows/resume", method="POST").code == 200 assert all(not f.intercepted for f in self.view) + def test_kill(self): + for f in self.view: + f.backup() + f.reply.handle() + f.intercept(self.master) + + assert self.fetch("/flows/42/kill", method="POST").code == 200 + assert sum(f.killable for f in self.view) == 1 + assert self.fetch("/flows/kill", method="POST").code == 200 + assert all(not f.killable for f in self.view) + for f in self.view: + f.revert() + def test_flow_delete(self): f = self.view.get_by_id("42") assert f |