aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-10-16 18:48:22 +1300
committerAldo Cortesi <aldo@nullcube.com>2016-10-16 20:26:06 +1300
commit9a0195bf64e746d5932125122bd56ec150f928bf (patch)
tree076895d70e5b6d2dbbee526f4b3cb6f949936986 /test
parent57b8ed21a9a30eb79d9340d5e146e42bbafd0d46 (diff)
downloadmitmproxy-9a0195bf64e746d5932125122bd56ec150f928bf.tar.gz
mitmproxy-9a0195bf64e746d5932125122bd56ec150f928bf.tar.bz2
mitmproxy-9a0195bf64e746d5932125122bd56ec150f928bf.zip
scripts: keep scripts just after the ScriptLoader in addon chain
We need scripts to run _before_ filestreamer, so we can't just add them to the end of the chain. This patch also fixes an issue that could cause scripts to be initialised un-necessarily if only the order of scripts in options changed.
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/builtins/test_script.py8
-rw-r--r--test/mitmproxy/test_addons.py2
2 files changed, 3 insertions, 7 deletions
diff --git a/test/mitmproxy/builtins/test_script.py b/test/mitmproxy/builtins/test_script.py
index 261adb65..54451313 100644
--- a/test/mitmproxy/builtins/test_script.py
+++ b/test/mitmproxy/builtins/test_script.py
@@ -237,12 +237,8 @@ class TestScriptLoader(mastertest.MasterTest):
"%s %s" % (rec, "b"),
]
debug = [(i[0], i[1]) for i in m.event_log if i[0] == "debug"]
- assert debug == [
- ('debug', 'c configure'),
- ('debug', 'a configure'),
- ('debug', 'b configure'),
- ]
- m.event_log[:] = []
+ # No events, only order has changed
+ assert debug == []
o.scripts = [
"%s %s" % (rec, "x"),
diff --git a/test/mitmproxy/test_addons.py b/test/mitmproxy/test_addons.py
index 52d7f07f..c5d54e8c 100644
--- a/test/mitmproxy/test_addons.py
+++ b/test/mitmproxy/test_addons.py
@@ -16,6 +16,6 @@ def test_simple():
o = options.Options()
m = controller.Master(o)
a = addons.Addons(m)
- a.add(o, TAddon("one"))
+ a.add(TAddon("one"))
assert a.get("one")
assert not a.get("two")