From 4282dc1ac4053d774b0fe6993ae15222fcfe3b3d Mon Sep 17 00:00:00 2001 From: Matthew Shao Date: Wed, 26 Jul 2017 15:16:23 +0800 Subject: [web] Update tests. --- test/mitmproxy/tools/test_dump.py | 2 +- test/mitmproxy/tools/web/test_app.py | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/mitmproxy/tools/test_dump.py b/test/mitmproxy/tools/test_dump.py index 69a76d2e..597333af 100644 --- a/test/mitmproxy/tools/test_dump.py +++ b/test/mitmproxy/tools/test_dump.py @@ -12,7 +12,7 @@ from .. import tservers class TestDumpMaster(tservers.MasterTest): def mkmaster(self, flt, **opts): - o = options.Options(view_filter=flt, verbosity=-1, flow_detail=0, **opts) + o = options.Options(view_filter=flt, verbosity='error', flow_detail=0, **opts) m = dump.DumpMaster(o, proxy.DummyServer(), with_termlog=False, with_dumper=False) return m diff --git a/test/mitmproxy/tools/web/test_app.py b/test/mitmproxy/tools/web/test_app.py index bb0b1907..119d7b1d 100644 --- a/test/mitmproxy/tools/web/test_app.py +++ b/test/mitmproxy/tools/web/test_app.py @@ -264,16 +264,7 @@ class TestApp(tornado.testing.AsyncHTTPTestCase): assert self.put_json("/options", {"anticache": "foo"}).code == 400 def test_option_dump(self): - resp = self.fetch("/options/dump") - assert b"http2: false" in resp.body - - assert self.fetch("/options/dump", method="POST", body=b"http2: true").code == 200 - j = json(self.fetch("/options")) - assert j["http2"]["value"] - - resp = self.fetch("/options/dump", method="POST", body=b"wtf: true") - assert resp.code == 400 - assert resp.body == b"'Unknown options: wtf'" + assert self.fetch("/options/dump", method="POST").code == 200 def test_err(self): with mock.patch("mitmproxy.tools.web.app.IndexHandler.get") as f: -- cgit v1.2.3