aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/addons/test_core.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/mitmproxy/addons/test_core.py b/test/mitmproxy/addons/test_core.py
new file mode 100644
index 00000000..99bf3f40
--- /dev/null
+++ b/test/mitmproxy/addons/test_core.py
@@ -0,0 +1,15 @@
+from mitmproxy.addons import core
+from mitmproxy.test import taddons
+from mitmproxy import exceptions
+import pytest
+
+
+def test_set():
+ sa = core.Core()
+ with taddons.context() as tctx:
+ assert not tctx.master.options.anticomp
+ tctx.command(sa.set, "anticomp")
+ assert tctx.master.options.anticomp
+
+ with pytest.raises(exceptions.CommandError):
+ tctx.command(sa.set, "nonexistent")