aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/addons/test_onboarding.py15
-rw-r--r--test/mitmproxy/addons/test_serverplayback.py1
-rw-r--r--test/mitmproxy/data/addonscripts/addon.py4
-rw-r--r--test/mitmproxy/proxy/test_server.py2
-rw-r--r--test/mitmproxy/tools/console/test_master.py2
-rw-r--r--test/mitmproxy/tservers.py2
6 files changed, 15 insertions, 11 deletions
diff --git a/test/mitmproxy/addons/test_onboarding.py b/test/mitmproxy/addons/test_onboarding.py
index 63125c23..42a3b574 100644
--- a/test/mitmproxy/addons/test_onboarding.py
+++ b/test/mitmproxy/addons/test_onboarding.py
@@ -1,4 +1,5 @@
from mitmproxy.addons import onboarding
+from mitmproxy.test import taddons
from .. import tservers
@@ -7,10 +8,14 @@ class TestApp(tservers.HTTPProxyTest):
return [onboarding.Onboarding()]
def test_basic(self):
- assert self.app("/").status_code == 200
+ with taddons.context() as tctx:
+ tctx.configure(self.addons()[0])
+ assert self.app("/").status_code == 200
def test_cert(self):
- for ext in ["pem", "p12"]:
- resp = self.app("/cert/%s" % ext)
- assert resp.status_code == 200
- assert resp.content
+ with taddons.context() as tctx:
+ tctx.configure(self.addons()[0])
+ for ext in ["pem", "p12"]:
+ resp = self.app("/cert/%s" % ext)
+ assert resp.status_code == 200
+ assert resp.content
diff --git a/test/mitmproxy/addons/test_serverplayback.py b/test/mitmproxy/addons/test_serverplayback.py
index c92f80b8..29de48a0 100644
--- a/test/mitmproxy/addons/test_serverplayback.py
+++ b/test/mitmproxy/addons/test_serverplayback.py
@@ -6,7 +6,6 @@ from mitmproxy.test import tflow
import mitmproxy.test.tutils
from mitmproxy.addons import serverplayback
-from mitmproxy import options
from mitmproxy import exceptions
from mitmproxy import io
diff --git a/test/mitmproxy/data/addonscripts/addon.py b/test/mitmproxy/data/addonscripts/addon.py
index 8bd25808..8c834d82 100644
--- a/test/mitmproxy/data/addonscripts/addon.py
+++ b/test/mitmproxy/data/addonscripts/addon.py
@@ -9,11 +9,11 @@ class Addon:
def load(self, opts):
event_log.append("addonload")
- def configure(self, options, updated):
+ def configure(self, updated):
event_log.append("addonconfigure")
-def configure(options, updated):
+def configure(updated):
event_log.append("scriptconfigure")
diff --git a/test/mitmproxy/proxy/test_server.py b/test/mitmproxy/proxy/test_server.py
index b54a764f..b4bb46bb 100644
--- a/test/mitmproxy/proxy/test_server.py
+++ b/test/mitmproxy/proxy/test_server.py
@@ -297,7 +297,7 @@ class TestHTTPAuth(tservers.HTTPProxyTest):
def test_auth(self):
self.master.addons.add(proxyauth.ProxyAuth())
self.master.addons.trigger(
- "configure", self.master.options, self.master.options.keys()
+ "configure", self.master.options.keys()
)
self.master.options.proxyauth = "test:test"
assert self.pathod("202").status_code == 407
diff --git a/test/mitmproxy/tools/console/test_master.py b/test/mitmproxy/tools/console/test_master.py
index add8c4d3..c87c9e83 100644
--- a/test/mitmproxy/tools/console/test_master.py
+++ b/test/mitmproxy/tools/console/test_master.py
@@ -30,7 +30,7 @@ class TestMaster(tservers.MasterTest):
opts["verbosity"] = 1
o = options.Options(**opts)
m = console.master.ConsoleMaster(o, proxy.DummyServer())
- m.addons.trigger("configure", o, o.keys())
+ m.addons.trigger("configure", o.keys())
return m
def test_basic(self):
diff --git a/test/mitmproxy/tservers.py b/test/mitmproxy/tservers.py
index d8dda5eb..b8005529 100644
--- a/test/mitmproxy/tservers.py
+++ b/test/mitmproxy/tservers.py
@@ -74,7 +74,7 @@ class TestMaster(taddons.RecordingMaster):
self.state = TestState()
self.addons.add(self.state)
self.addons.add(*addons)
- self.addons.trigger("configure", self.options, self.options.keys())
+ self.addons.trigger("configure", self.options.keys())
self.addons.trigger("running")
def reset(self, addons):