diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2018-02-24 19:16:13 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2018-02-24 19:16:13 +1300 |
commit | 6ea81a96d49c06e2877b727ee7c2d350d3e1a167 (patch) | |
tree | 8c2c5b0a96b07daf7cf2010170da99ae7ed42ec2 /test | |
parent | 59db25bd0ff2faaab7ba982cf51d472e108612f6 (diff) | |
download | mitmproxy-6ea81a96d49c06e2877b727ee7c2d350d3e1a167.tar.gz mitmproxy-6ea81a96d49c06e2877b727ee7c2d350d3e1a167.tar.bz2 mitmproxy-6ea81a96d49c06e2877b727ee7c2d350d3e1a167.zip |
addon options: proxyauth to /addons
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/addons/test_allowremote.py | 5 | ||||
-rw-r--r-- | test/mitmproxy/addons/test_proxyauth.py | 10 |
2 files changed, 8 insertions, 7 deletions
diff --git a/test/mitmproxy/addons/test_allowremote.py b/test/mitmproxy/addons/test_allowremote.py index 52dae68d..69019726 100644 --- a/test/mitmproxy/addons/test_allowremote.py +++ b/test/mitmproxy/addons/test_allowremote.py @@ -1,7 +1,7 @@ from unittest import mock import pytest -from mitmproxy.addons import allowremote +from mitmproxy.addons import allowremote, proxyauth from mitmproxy.test import taddons @@ -19,7 +19,8 @@ from mitmproxy.test import taddons ]) def test_allowremote(allow_remote, ip, should_be_killed): ar = allowremote.AllowRemote() - with taddons.context(ar) as tctx: + up = proxyauth.ProxyAuth() + with taddons.context(ar, up) as tctx: tctx.options.allow_remote = allow_remote with mock.patch('mitmproxy.proxy.protocol.base.Layer') as layer: diff --git a/test/mitmproxy/addons/test_proxyauth.py b/test/mitmproxy/addons/test_proxyauth.py index 97259d1c..9e2365cf 100644 --- a/test/mitmproxy/addons/test_proxyauth.py +++ b/test/mitmproxy/addons/test_proxyauth.py @@ -49,7 +49,7 @@ class TestProxyAuth: ]) def test_is_proxy_auth(self, mode, expected): up = proxyauth.ProxyAuth() - with taddons.context() as ctx: + with taddons.context(up) as ctx: ctx.options.mode = mode assert up.is_proxy_auth() is expected @@ -75,7 +75,7 @@ class TestProxyAuth: def test_check(self): up = proxyauth.ProxyAuth() - with taddons.context() as ctx: + with taddons.context(up) as ctx: ctx.configure(up, proxyauth="any", mode="regular") f = tflow.tflow() assert not up.check(f) @@ -133,7 +133,7 @@ class TestProxyAuth: def test_authenticate(self): up = proxyauth.ProxyAuth() - with taddons.context() as ctx: + with taddons.context(up) as ctx: ctx.configure(up, proxyauth="any", mode="regular") f = tflow.tflow() @@ -165,7 +165,7 @@ class TestProxyAuth: def test_configure(self): up = proxyauth.ProxyAuth() - with taddons.context() as ctx: + with taddons.context(up) as ctx: with pytest.raises(exceptions.OptionsError): ctx.configure(up, proxyauth="foo") @@ -223,7 +223,7 @@ class TestProxyAuth: def test_handlers(self): up = proxyauth.ProxyAuth() - with taddons.context() as ctx: + with taddons.context(up) as ctx: ctx.configure(up, proxyauth="any", mode="regular") f = tflow.tflow() |