From a617e3b5f717b95d1ffc8c87dd70712e36445be9 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 5 Dec 2016 17:49:16 +1300 Subject: Amalgamate all the Options objects --- test/mitmproxy/console/test_master.py | 11 ++++++----- test/mitmproxy/test_web_app.py | 3 ++- test/mitmproxy/test_web_master.py | 5 +++-- 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/mitmproxy/console/test_master.py b/test/mitmproxy/console/test_master.py index eb840187..fb3c2527 100644 --- a/test/mitmproxy/console/test_master.py +++ b/test/mitmproxy/console/test_master.py @@ -2,6 +2,7 @@ from mitmproxy.test import tflow import mitmproxy.test.tutils from mitmproxy.tools import console from mitmproxy import proxy +from mitmproxy import options from mitmproxy.tools.console import common from .. import mastertest @@ -20,14 +21,14 @@ def test_format_keyvals(): def test_options(): - assert console.master.Options(replay_kill_extra=True) + assert options.Options(replay_kill_extra=True) class TestMaster(mastertest.MasterTest): - def mkmaster(self, **options): - if "verbosity" not in options: - options["verbosity"] = 0 - o = console.master.Options(**options) + def mkmaster(self, **opts): + if "verbosity" not in opts: + opts["verbosity"] = 0 + o = options.Options(**opts) return console.master.ConsoleMaster(o, proxy.DummyServer()) def test_basic(self): diff --git a/test/mitmproxy/test_web_app.py b/test/mitmproxy/test_web_app.py index be195528..2cab5bf4 100644 --- a/test/mitmproxy/test_web_app.py +++ b/test/mitmproxy/test_web_app.py @@ -4,6 +4,7 @@ import mock import tornado.testing from mitmproxy import exceptions from mitmproxy import proxy +from mitmproxy import options from mitmproxy.test import tflow from mitmproxy.tools.web import app from mitmproxy.tools.web import master as webmaster @@ -17,7 +18,7 @@ def json(resp: httpclient.HTTPResponse): class TestApp(tornado.testing.AsyncHTTPTestCase): def get_app(self): - o = webmaster.Options() + o = options.Options() m = webmaster.WebMaster(o, proxy.DummyServer()) f = tflow.tflow(resp=True) f.id = "42" diff --git a/test/mitmproxy/test_web_master.py b/test/mitmproxy/test_web_master.py index 298b14eb..08dce8f3 100644 --- a/test/mitmproxy/test_web_master.py +++ b/test/mitmproxy/test_web_master.py @@ -1,11 +1,12 @@ from mitmproxy.tools.web import master from mitmproxy import proxy +from mitmproxy import options from . import mastertest class TestWebMaster(mastertest.MasterTest): - def mkmaster(self, **options): - o = master.Options(**options) + def mkmaster(self, **opts): + o = options.Options(**opts) return master.WebMaster(o, proxy.DummyServer(o)) def test_basic(self): -- cgit v1.2.3