From d854e08653ccee12119266e2cc3f5d6c279341e5 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 11 Dec 2016 22:52:17 +0100 Subject: [web] various fixes --- test/mitmproxy/test_web_app.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'test') 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 -- cgit v1.2.3