aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/addons/test_intercept.py25
-rw-r--r--test/mitmproxy/mastertest.py4
2 files changed, 25 insertions, 4 deletions
diff --git a/test/mitmproxy/addons/test_intercept.py b/test/mitmproxy/addons/test_intercept.py
index e69de29b..19828a62 100644
--- a/test/mitmproxy/addons/test_intercept.py
+++ b/test/mitmproxy/addons/test_intercept.py
@@ -0,0 +1,25 @@
+from mitmproxy.addons import intercept
+from mitmproxy import options
+from mitmproxy import exceptions
+from mitmproxy.test import taddons
+from mitmproxy.test import tutils
+
+
+class Options(options.Options):
+ def __init__(self, *, intercept=None, **kwargs):
+ self.intercept = intercept
+ super().__init__(**kwargs)
+
+
+def test_simple():
+ r = intercept.Intercept()
+ with taddons.context(options=Options()) as tctx:
+ assert not r.filt
+ tctx.configure(r, intercept="~q")
+ assert r.filt
+ tutils.raises(
+ exceptions.OptionsError,
+ tctx.configure,
+ r,
+ intercept="~~"
+ )
diff --git a/test/mitmproxy/mastertest.py b/test/mitmproxy/mastertest.py
index cdfb5ad5..0672add9 100644
--- a/test/mitmproxy/mastertest.py
+++ b/test/mitmproxy/mastertest.py
@@ -10,10 +10,6 @@ from mitmproxy import http
from mitmproxy import options
-class TestMaster:
- pass
-
-
class MasterTest:
def cycle(self, master, content):