aboutsummaryrefslogtreecommitdiffstats
path: root/test/mitmproxy/addons/test_core.py
diff options
context:
space:
mode:
authorkira0204 <rshtmudgal@gmail.com>2018-02-24 12:42:21 +0530
committerkira0204 <rshtmudgal@gmail.com>2018-02-24 12:42:21 +0530
commit8209b89d41bdfc3b6a9a3dd5d9054b02722e0d4f (patch)
tree5691f1dd11ac1b2a98e57ed06252ff7dc40cd555 /test/mitmproxy/addons/test_core.py
parent69dbd1da61e6e452da63c63fba1d810b269f459d (diff)
parenteee109117f956600261bc938be52040d1474a97f (diff)
downloadmitmproxy-8209b89d41bdfc3b6a9a3dd5d9054b02722e0d4f.tar.gz
mitmproxy-8209b89d41bdfc3b6a9a3dd5d9054b02722e0d4f.tar.bz2
mitmproxy-8209b89d41bdfc3b6a9a3dd5d9054b02722e0d4f.zip
Merge branch 'master' of https://github.com/kira0204/mitmproxy into update-readme
Diffstat (limited to 'test/mitmproxy/addons/test_core.py')
-rw-r--r--test/mitmproxy/addons/test_core.py25
1 files changed, 10 insertions, 15 deletions
diff --git a/test/mitmproxy/addons/test_core.py b/test/mitmproxy/addons/test_core.py
index 5aa4ef37..3f95bed4 100644
--- a/test/mitmproxy/addons/test_core.py
+++ b/test/mitmproxy/addons/test_core.py
@@ -10,9 +10,9 @@ def test_set():
with taddons.context() as tctx:
tctx.master.addons.add(sa)
- assert not tctx.master.options.anticomp
- tctx.command(sa.set, "anticomp")
- assert tctx.master.options.anticomp
+ assert tctx.master.options.server
+ tctx.command(sa.set, "server=false")
+ assert not tctx.master.options.server
with pytest.raises(exceptions.CommandError):
tctx.command(sa.set, "nonexistent")
@@ -128,28 +128,23 @@ def test_options(tmpdir):
p = str(tmpdir.join("path"))
sa = core.Core()
with taddons.context() as tctx:
- tctx.options.stickycookie = "foo"
- assert tctx.options.stickycookie == "foo"
- sa.options_reset()
- assert tctx.options.stickycookie is None
-
- tctx.options.stickycookie = "foo"
- tctx.options.stickyauth = "bar"
- sa.options_reset_one("stickycookie")
- assert tctx.options.stickycookie is None
- assert tctx.options.stickyauth == "bar"
+ tctx.options.listen_host = "foo"
+ assert tctx.options.listen_host == "foo"
+ sa.options_reset_one("listen_host")
+ assert tctx.options.listen_host != "foo"
with pytest.raises(exceptions.CommandError):
sa.options_reset_one("unknown")
+ tctx.options.listen_host = "foo"
sa.options_save(p)
with pytest.raises(exceptions.CommandError):
sa.options_save("/")
sa.options_reset()
- assert tctx.options.stickyauth is None
+ assert tctx.options.listen_host == ""
sa.options_load(p)
- assert tctx.options.stickyauth == "bar"
+ assert tctx.options.listen_host == "foo"
sa.options_load("/nonexistent")