aboutsummaryrefslogtreecommitdiffstats
path: root/test/mitmproxy/tools/console/test_master.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2017-03-09 13:52:58 +1300
committerAldo Cortesi <aldo@corte.si>2017-03-14 08:32:19 +1300
commit0c6663d0d5335e666598807c2e5d8f105803eac0 (patch)
treee6782b2e102aca959ad6e30739f816dbad89cbb9 /test/mitmproxy/tools/console/test_master.py
parentee65894d40f5a9f73125a8d3e73ba50540939e5b (diff)
downloadmitmproxy-0c6663d0d5335e666598807c2e5d8f105803eac0.tar.gz
mitmproxy-0c6663d0d5335e666598807c2e5d8f105803eac0.tar.bz2
mitmproxy-0c6663d0d5335e666598807c2e5d8f105803eac0.zip
Enable custom options for addons
- Add an options parameter to the start() event. This is to be used by addons on startup to add custom options. - Add a running() event that is called once the proxy is up and running. - With the new paradigm we can't log during master __init__, so add a tiny termstatus addon to print proxy status to terminal once we're running.
Diffstat (limited to 'test/mitmproxy/tools/console/test_master.py')
-rw-r--r--test/mitmproxy/tools/console/test_master.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/mitmproxy/tools/console/test_master.py b/test/mitmproxy/tools/console/test_master.py
index 0bf3734b..6c716ad1 100644
--- a/test/mitmproxy/tools/console/test_master.py
+++ b/test/mitmproxy/tools/console/test_master.py
@@ -28,7 +28,9 @@ class TestMaster(tservers.MasterTest):
if "verbosity" not in opts:
opts["verbosity"] = 1
o = options.Options(**opts)
- return console.master.ConsoleMaster(o, proxy.DummyServer())
+ m = console.master.ConsoleMaster(o, proxy.DummyServer())
+ m.addons.configure_all(o, o.keys())
+ return m
def test_basic(self):
m = self.mkmaster()