diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-12-11 22:52:17 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-12-12 00:08:29 +0100 |
commit | d854e08653ccee12119266e2cc3f5d6c279341e5 (patch) | |
tree | a58d465ea62fdb9665389b39c284d689f2b94e78 /test | |
parent | d1c7b203f08d4b1e1ee3c7a50762a4f08843feef (diff) | |
download | mitmproxy-d854e08653ccee12119266e2cc3f5d6c279341e5.tar.gz mitmproxy-d854e08653ccee12119266e2cc3f5d6c279341e5.tar.bz2 mitmproxy-d854e08653ccee12119266e2cc3f5d6c279341e5.zip |
[web] various fixes
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 |