aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatthew Shao <me@matshao.com>2017-06-23 10:45:04 +0800
committerMatthew Shao <me@matshao.com>2017-06-23 10:58:59 +0800
commitc7ce7f84e6283fa08e87ee5ee35fd6053a2ab615 (patch)
tree73429b6f6bcae2f0c1848139b9a0b48f2386559a /test
parentab162361a1fe6d773807caa6071d49bdcf68b612 (diff)
downloadmitmproxy-c7ce7f84e6283fa08e87ee5ee35fd6053a2ab615.tar.gz
mitmproxy-c7ce7f84e6283fa08e87ee5ee35fd6053a2ab615.tar.bz2
mitmproxy-c7ce7f84e6283fa08e87ee5ee35fd6053a2ab615.zip
Add test for POST /options API of mitmweb.
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/tools/web/test_app.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/mitmproxy/tools/web/test_app.py b/test/mitmproxy/tools/web/test_app.py
index d47b1af0..401f9fe6 100644
--- a/test/mitmproxy/tools/web/test_app.py
+++ b/test/mitmproxy/tools/web/test_app.py
@@ -258,6 +258,10 @@ class TestApp(tornado.testing.AsyncHTTPTestCase):
assert type(j) == list
assert type(j[0]) == dict
+ def test_option_update(self):
+ assert self.put_json("/options", {"anticache": True}).code == 200
+ assert self.put_json("/options", {"wtf": True}).code == 400
+
def test_err(self):
with mock.patch("mitmproxy.tools.web.app.IndexHandler.get") as f:
f.side_effect = RuntimeError