diff options
author | Aldo Cortesi <aldo@corte.si> | 2018-02-26 11:26:32 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@corte.si> | 2018-02-26 11:26:32 +1300 |
commit | 7bd63ee713650f2c22f3193f52a793f92eea75c4 (patch) | |
tree | c408223978e4a43b1841a749d7718ed59c750801 /mitmproxy/test | |
parent | e5cdc20eb8cd8ebf5ab0ab8bd5ae9889054821df (diff) | |
download | mitmproxy-7bd63ee713650f2c22f3193f52a793f92eea75c4.tar.gz mitmproxy-7bd63ee713650f2c22f3193f52a793f92eea75c4.tar.bz2 mitmproxy-7bd63ee713650f2c22f3193f52a793f92eea75c4.zip |
Start consolidating core options
This is a preparatory patch that paves the way to consolidating our core
options in the core addon. It amalgamates the core_option_validation and core
addons, prepares the test suite for a world where options live in core, and
moves over two trivial options as a trial balloon.
From here, things will get harder, but at the end of the process we'll have a
core that's responsive to options.
Diffstat (limited to 'mitmproxy/test')
-rw-r--r-- | mitmproxy/test/taddons.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mitmproxy/test/taddons.py b/mitmproxy/test/taddons.py index 1ca8ba8d..82a935d2 100644 --- a/mitmproxy/test/taddons.py +++ b/mitmproxy/test/taddons.py @@ -6,7 +6,7 @@ import mitmproxy.options from mitmproxy import addonmanager from mitmproxy import command from mitmproxy import eventsequence -from mitmproxy.addons import script +from mitmproxy.addons import script, core class TestAddons(addonmanager.AddonManager): @@ -59,7 +59,7 @@ class context: provides a number of helper methods for common testing scenarios. """ - def __init__(self, *addons, options=None): + def __init__(self, *addons, options=None, loadcore=True): options = options or mitmproxy.options.Options() self.master = RecordingMaster( options @@ -67,6 +67,9 @@ class context: self.options = self.master.options self.wrapped = None + if loadcore: + self.master.addons.add(core.Core()) + for a in addons: self.master.addons.add(a) |