From 2ceaa5c9efd3bbbb7fdb6b0d3ebdb8de32305f92 Mon Sep 17 00:00:00 2001 From: Matthew Shao Date: Tue, 1 Aug 2017 08:42:51 +0800 Subject: Update tests. --- test/mitmproxy/addons/test_view.py | 12 ++++++++---- test/mitmproxy/tools/console/test_statusbar.py | 2 -- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/mitmproxy/addons/test_view.py b/test/mitmproxy/addons/test_view.py index e8eeb591..9a9534f9 100644 --- a/test/mitmproxy/addons/test_view.py +++ b/test/mitmproxy/addons/test_view.py @@ -7,6 +7,10 @@ from mitmproxy import flowfilter from mitmproxy import exceptions from mitmproxy import io from mitmproxy.test import taddons +from mitmproxy import options +from mitmproxy.tools.console.master import ConsoleMaster + +m = ConsoleMaster(options.Options()) def tft(*, method="get", start=0): @@ -26,7 +30,7 @@ def test_order_refresh(): v.sig_view_refresh.connect(save) tf = tflow.tflow(resp=True) - with taddons.context() as tctx: + with taddons.context(m) as tctx: tctx.configure(v, console_order="time") v.add([tf]) tf.request.timestamp_start = 1 @@ -293,7 +297,7 @@ def test_setgetval(): def test_order(): v = view.View() - with taddons.context() as tctx: + with taddons.context(m) as tctx: v.request(tft(method="get", start=1)) v.request(tft(method="put", start=2)) v.request(tft(method="get", start=3)) @@ -424,7 +428,7 @@ def test_signals(): def test_focus_follow(): v = view.View() - with taddons.context() as tctx: + with taddons.context(m) as tctx: tctx.configure(v, console_focus_follow=True, view_filter="~m get") v.add([tft(start=5)]) @@ -541,7 +545,7 @@ def test_settings(): def test_configure(): v = view.View() - with taddons.context() as tctx: + with taddons.context(m) as tctx: tctx.configure(v, view_filter="~q") with pytest.raises(Exception, match="Invalid interception filter"): tctx.configure(v, view_filter="~~") diff --git a/test/mitmproxy/tools/console/test_statusbar.py b/test/mitmproxy/tools/console/test_statusbar.py index 2f7825c9..34981e42 100644 --- a/test/mitmproxy/tools/console/test_statusbar.py +++ b/test/mitmproxy/tools/console/test_statusbar.py @@ -13,14 +13,12 @@ def test_statusbar(monkeypatch): stickycookie="~dst example.com", stickyauth="~dst example.com", default_contentview="javascript", - console_order="url", anticache=True, anticomp=True, showhost=True, refresh_server_playback=False, replay_kill_extra=True, upstream_cert=False, - console_focus_follow=True, stream_large_bodies="3m", mode="transparent", scripts=["nonexistent"], -- cgit v1.2.3