aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-09-24 18:21:12 -0700
committerGitHub <noreply@github.com>2016-09-24 18:21:12 -0700
commit0a643ad20fa45c2fbd8a9de16aa7d632bd89d190 (patch)
tree13f1880af20c9144afa4edbb215a3771b6b246d8 /test
parent92dd030c22a48f8e65638e8cbac633318f203132 (diff)
downloadmitmproxy-0a643ad20fa45c2fbd8a9de16aa7d632bd89d190.tar.gz
mitmproxy-0a643ad20fa45c2fbd8a9de16aa7d632bd89d190.tar.bz2
mitmproxy-0a643ad20fa45c2fbd8a9de16aa7d632bd89d190.zip
remove option argument for addons.add (#1576)
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/builtins/test_anticache.py2
-rw-r--r--test/mitmproxy/builtins/test_anticomp.py2
-rw-r--r--test/mitmproxy/builtins/test_dumper.py2
-rw-r--r--test/mitmproxy/builtins/test_filestreamer.py4
-rw-r--r--test/mitmproxy/builtins/test_replace.py2
-rw-r--r--test/mitmproxy/builtins/test_script.py15
-rw-r--r--test/mitmproxy/builtins/test_serverplayback.py4
-rw-r--r--test/mitmproxy/builtins/test_setheaders.py2
-rw-r--r--test/mitmproxy/builtins/test_stickyauth.py2
-rw-r--r--test/mitmproxy/builtins/test_stickycookie.py4
-rw-r--r--test/mitmproxy/script/test_concurrent.py2
-rw-r--r--test/mitmproxy/test_examples.py2
-rw-r--r--test/mitmproxy/test_server.py4
-rw-r--r--test/mitmproxy/tservers.py2
14 files changed, 24 insertions, 25 deletions
diff --git a/test/mitmproxy/builtins/test_anticache.py b/test/mitmproxy/builtins/test_anticache.py
index 8897de52..81041e73 100644
--- a/test/mitmproxy/builtins/test_anticache.py
+++ b/test/mitmproxy/builtins/test_anticache.py
@@ -11,7 +11,7 @@ class TestAntiCache(mastertest.MasterTest):
o = options.Options(anticache = True)
m = master.FlowMaster(o, None, s)
sa = anticache.AntiCache()
- m.addons.add(o, sa)
+ m.addons.add(sa)
f = tutils.tflow(resp=True)
m.request(f)
diff --git a/test/mitmproxy/builtins/test_anticomp.py b/test/mitmproxy/builtins/test_anticomp.py
index af9e4a6a..f866f33f 100644
--- a/test/mitmproxy/builtins/test_anticomp.py
+++ b/test/mitmproxy/builtins/test_anticomp.py
@@ -11,7 +11,7 @@ class TestAntiComp(mastertest.MasterTest):
o = options.Options(anticomp = True)
m = master.FlowMaster(o, None, s)
sa = anticomp.AntiComp()
- m.addons.add(o, sa)
+ m.addons.add(sa)
f = tutils.tflow(resp=True)
m.request(f)
diff --git a/test/mitmproxy/builtins/test_dumper.py b/test/mitmproxy/builtins/test_dumper.py
index 9b518b53..9df187a5 100644
--- a/test/mitmproxy/builtins/test_dumper.py
+++ b/test/mitmproxy/builtins/test_dumper.py
@@ -79,6 +79,6 @@ class TestContentView(mastertest.MasterTest):
)
m = mastertest.RecordingMaster(o, None, s)
d = dumper.Dumper()
- m.addons.add(o, d)
+ m.addons.add(d)
m.response(tutils.tflow())
assert "Content viewer failed" in m.event_log[0][1]
diff --git a/test/mitmproxy/builtins/test_filestreamer.py b/test/mitmproxy/builtins/test_filestreamer.py
index 94d68813..7964c69a 100644
--- a/test/mitmproxy/builtins/test_filestreamer.py
+++ b/test/mitmproxy/builtins/test_filestreamer.py
@@ -26,7 +26,7 @@ class TestStream(mastertest.MasterTest):
m = master.FlowMaster(o, None, s)
sa = filestreamer.FileStreamer()
- m.addons.add(o, sa)
+ m.addons.add(sa)
f = tutils.tflow(resp=True)
m.request(f)
m.response(f)
@@ -36,7 +36,7 @@ class TestStream(mastertest.MasterTest):
m.options.outfile = (p, "ab")
- m.addons.add(o, sa)
+ m.addons.add(sa)
f = tutils.tflow()
m.request(f)
m.addons.remove(sa)
diff --git a/test/mitmproxy/builtins/test_replace.py b/test/mitmproxy/builtins/test_replace.py
index 07abcda4..e9869ab7 100644
--- a/test/mitmproxy/builtins/test_replace.py
+++ b/test/mitmproxy/builtins/test_replace.py
@@ -39,7 +39,7 @@ class TestReplace(mastertest.MasterTest):
)
m = master.FlowMaster(o, None, s)
sa = replace.Replace()
- m.addons.add(o, sa)
+ m.addons.add(sa)
f = tutils.tflow()
f.request.content = b"foo"
diff --git a/test/mitmproxy/builtins/test_script.py b/test/mitmproxy/builtins/test_script.py
index 24337760..f92765ee 100644
--- a/test/mitmproxy/builtins/test_script.py
+++ b/test/mitmproxy/builtins/test_script.py
@@ -63,7 +63,7 @@ class TestScript(mastertest.MasterTest):
"data/addonscripts/recorder.py"
)
)
- m.addons.add(o, sc)
+ m.addons.add(sc)
assert sc.ns.call_log == [
("solo", "start", (), {}),
("solo", "configure", (o, o.keys()), {})
@@ -84,7 +84,7 @@ class TestScript(mastertest.MasterTest):
with open("foo.py", "w"):
pass
sc = script.Script("foo.py")
- m.addons.add(o, sc)
+ m.addons.add(sc)
for _ in range(100):
with open("foo.py", "a") as f:
@@ -102,7 +102,7 @@ class TestScript(mastertest.MasterTest):
sc = script.Script(
tutils.test_data.path("data/addonscripts/error.py")
)
- m.addons.add(o, sc)
+ m.addons.add(sc)
f = tutils.tflow(resp=True)
m.request(f)
assert m.event_log[0][0] == "error"
@@ -116,7 +116,6 @@ class TestScript(mastertest.MasterTest):
o = options.Options()
fm = master.FlowMaster(o, None, s)
fm.addons.add(
- o,
script.Script(
tutils.test_data.path("data/addonscripts/duplicate_flow.py")
)
@@ -136,7 +135,7 @@ class TestScript(mastertest.MasterTest):
"data/addonscripts/addon.py"
)
)
- m.addons.add(o, sc)
+ m.addons.add(sc)
assert sc.ns.event_log == [
'scriptstart', 'addonstart', 'addonconfigure'
]
@@ -166,7 +165,7 @@ class TestScriptLoader(mastertest.MasterTest):
o = options.Options(scripts=[])
m = master.FlowMaster(o, None, s)
sl = script.ScriptLoader()
- m.addons.add(o, sl)
+ m.addons.add(sl)
f = tutils.tflow(resp=True)
with m.handlecontext():
@@ -191,7 +190,7 @@ class TestScriptLoader(mastertest.MasterTest):
o = options.Options(scripts=[])
m = master.FlowMaster(o, None, s)
sc = script.ScriptLoader()
- m.addons.add(o, sc)
+ m.addons.add(sc)
assert len(m.addons) == 1
o.update(
scripts = [
@@ -222,7 +221,7 @@ class TestScriptLoader(mastertest.MasterTest):
)
m = mastertest.RecordingMaster(o, None, s)
sc = script.ScriptLoader()
- m.addons.add(o, sc)
+ m.addons.add(sc)
debug = [(i[0], i[1]) for i in m.event_log if i[0] == "debug"]
assert debug == [
diff --git a/test/mitmproxy/builtins/test_serverplayback.py b/test/mitmproxy/builtins/test_serverplayback.py
index 4db509da..55ce9350 100644
--- a/test/mitmproxy/builtins/test_serverplayback.py
+++ b/test/mitmproxy/builtins/test_serverplayback.py
@@ -242,7 +242,7 @@ class TestServerPlayback:
s = serverplayback.ServerPlayback()
o = options.Options(refresh_server_playback = True, keepserving=False)
m = mastertest.RecordingMaster(o, None, state)
- m.addons.add(o, s)
+ m.addons.add(s)
f = tutils.tflow()
f.response = netlib.tutils.tresp(content=f.request.content)
@@ -272,7 +272,7 @@ class TestServerPlayback:
s = serverplayback.ServerPlayback()
o = options.Options(refresh_server_playback = True, replay_kill_extra=True)
m = mastertest.RecordingMaster(o, None, state)
- m.addons.add(o, s)
+ m.addons.add(s)
f = tutils.tflow()
f.response = netlib.tutils.tresp(content=f.request.content)
diff --git a/test/mitmproxy/builtins/test_setheaders.py b/test/mitmproxy/builtins/test_setheaders.py
index 63685177..d148234d 100644
--- a/test/mitmproxy/builtins/test_setheaders.py
+++ b/test/mitmproxy/builtins/test_setheaders.py
@@ -11,7 +11,7 @@ class TestSetHeaders(mastertest.MasterTest):
o = options.Options(**opts)
m = mastertest.RecordingMaster(o, None, s)
sh = setheaders.SetHeaders()
- m.addons.add(o, sh)
+ m.addons.add(sh)
return m, sh
def test_configure(self):
diff --git a/test/mitmproxy/builtins/test_stickyauth.py b/test/mitmproxy/builtins/test_stickyauth.py
index 00b12072..8b939c24 100644
--- a/test/mitmproxy/builtins/test_stickyauth.py
+++ b/test/mitmproxy/builtins/test_stickyauth.py
@@ -11,7 +11,7 @@ class TestStickyAuth(mastertest.MasterTest):
o = options.Options(stickyauth = ".*")
m = master.FlowMaster(o, None, s)
sa = stickyauth.StickyAuth()
- m.addons.add(o, sa)
+ m.addons.add(sa)
f = tutils.tflow(resp=True)
f.request.headers["authorization"] = "foo"
diff --git a/test/mitmproxy/builtins/test_stickycookie.py b/test/mitmproxy/builtins/test_stickycookie.py
index 13cea6a2..ed92013d 100644
--- a/test/mitmproxy/builtins/test_stickycookie.py
+++ b/test/mitmproxy/builtins/test_stickycookie.py
@@ -17,7 +17,7 @@ class TestStickyCookie(mastertest.MasterTest):
o = options.Options(stickycookie = ".*")
m = master.FlowMaster(o, None, s)
sc = stickycookie.StickyCookie()
- m.addons.add(o, sc)
+ m.addons.add(sc)
return s, m, sc
def test_config(self):
@@ -30,7 +30,7 @@ class TestStickyCookie(mastertest.MasterTest):
def test_simple(self):
s, m, sc = self.mk()
- m.addons.add(m.options, sc)
+ m.addons.add(sc)
f = tutils.tflow(resp=True)
f.response.headers["set-cookie"] = "foo=bar"
diff --git a/test/mitmproxy/script/test_concurrent.py b/test/mitmproxy/script/test_concurrent.py
index c4f1e9ae..5f943aeb 100644
--- a/test/mitmproxy/script/test_concurrent.py
+++ b/test/mitmproxy/script/test_concurrent.py
@@ -23,7 +23,7 @@ class TestConcurrent(mastertest.MasterTest):
"data/addonscripts/concurrent_decorator.py"
)
)
- m.addons.add(m.options, sc)
+ m.addons.add(sc)
f1, f2 = tutils.tflow(), tutils.tflow()
m.request(f1)
m.request(f2)
diff --git a/test/mitmproxy/test_examples.py b/test/mitmproxy/test_examples.py
index 83a37a36..1ba7ba7a 100644
--- a/test/mitmproxy/test_examples.py
+++ b/test/mitmproxy/test_examples.py
@@ -35,7 +35,7 @@ def tscript(cmd, args=""):
cmd = example_dir.path(cmd) + " " + args
m = RaiseMaster(o, None, state.State())
sc = script.Script(cmd)
- m.addons.add(o, sc)
+ m.addons.add(sc)
return m, sc
diff --git a/test/mitmproxy/test_server.py b/test/mitmproxy/test_server.py
index c5a5bb71..d1886b97 100644
--- a/test/mitmproxy/test_server.py
+++ b/test/mitmproxy/test_server.py
@@ -298,7 +298,7 @@ class TestHTTP(tservers.HTTPProxyTest, CommonMixin, AppMixin):
s = script.Script(
tutils.test_data.path("data/addonscripts/stream_modify.py")
)
- self.master.addons.add(self.master.options, s)
+ self.master.addons.add(s)
d = self.pathod('200:b"foo"')
assert d.content == b"bar"
self.master.addons.remove(s)
@@ -572,7 +572,7 @@ class TestTransparent(tservers.TransparentProxyTest, CommonMixin, TcpMixin):
s = script.Script(
tutils.test_data.path("data/addonscripts/tcp_stream_modify.py")
)
- self.master.addons.add(self.master.options, s)
+ self.master.addons.add(s)
self._tcpproxy_on()
d = self.pathod('200:b"foo"')
self._tcpproxy_off()
diff --git a/test/mitmproxy/tservers.py b/test/mitmproxy/tservers.py
index 4291f743..119c2cae 100644
--- a/test/mitmproxy/tservers.py
+++ b/test/mitmproxy/tservers.py
@@ -36,7 +36,7 @@ class TestMaster(flow.FlowMaster):
s = ProxyServer(config)
state = flow.State()
flow.FlowMaster.__init__(self, opts, s, state)
- self.addons.add(opts, *builtins.default_addons())
+ self.addons.add(*builtins.default_addons())
self.apps.add(testapp, "testapp", 80)
self.apps.add(errapp, "errapp", 80)
self.clear_log()