From 7f89a70edfe74e119e31fcd2082b8a3355627ee6 Mon Sep 17 00:00:00 2001 From: Anne Borcherding Date: Thu, 30 Apr 2020 14:12:11 +0200 Subject: [PATCH] moved addon for selenium authentication to examples/complex. Co-authored-by: weichweich <14820950+weichweich@users.noreply.github.com> --- .../addons => examples/complex}/proxyauth_selenium.py | 0 .../addons => examples}/test_proxyauth_selenium.py | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) rename {mitmproxy/addons => examples/complex}/proxyauth_selenium.py (100%) rename test/{mitmproxy/addons => examples}/test_proxyauth_selenium.py (93%) diff --git a/mitmproxy/addons/proxyauth_selenium.py b/examples/complex/proxyauth_selenium.py similarity index 100% rename from mitmproxy/addons/proxyauth_selenium.py rename to examples/complex/proxyauth_selenium.py diff --git a/test/mitmproxy/addons/test_proxyauth_selenium.py b/test/examples/test_proxyauth_selenium.py similarity index 93% rename from test/mitmproxy/addons/test_proxyauth_selenium.py rename to test/examples/test_proxyauth_selenium.py index 7824590c7..c0c4363bc 100644 --- a/test/mitmproxy/addons/test_proxyauth_selenium.py +++ b/test/examples/test_proxyauth_selenium.py @@ -7,7 +7,7 @@ from mitmproxy.test import tflow from mitmproxy.test import tutils from mitmproxy.http import HTTPFlow -from mitmproxy.addons.proxyauth_selenium import logger, randomString, AuthorizationOracle, SeleniumAddon +from examples.complex.proxyauth_selenium import logger, randomString, AuthorizationOracle, SeleniumAddon class TestRandomString: @@ -79,7 +79,7 @@ class TestSeleniumAddon: selenium_addon.set_cookies = False assert not selenium_addon.set_cookies with mock.patch.object(logger, 'debug') as mock_debug: - with mock.patch('mitmproxy.addons.proxyauth_selenium.SeleniumAddon.login', + with mock.patch('examples.complex.proxyauth_selenium.SeleniumAddon.login', return_value=[{"name": "cookie", "value": "test"}]) as mock_login: selenium_addon.request(f) mock_debug.assert_called() @@ -104,7 +104,7 @@ class TestSeleniumAddon: f = tflow.tflow(resp=tutils.tresp()) f.request.url = "http://example.com/login.php" selenium_addon.set_cookies = False - with mock.patch('mitmproxy.addons.proxyauth_selenium.SeleniumAddon.login', return_value=[]) as mock_login: + with mock.patch('examples.complex.proxyauth_selenium.SeleniumAddon.login', return_value=[]) as mock_login: selenium_addon.response(f) mock_login.assert_called() @@ -112,7 +112,7 @@ class TestSeleniumAddon: f = tflow.tflow(resp=tutils.tresp()) f.request.url = "http://example.com/login.php" selenium_addon.set_cookies = False - with mock.patch('mitmproxy.addons.proxyauth_selenium.SeleniumAddon.login', + with mock.patch('examples.complex.proxyauth_selenium.SeleniumAddon.login', return_value=[{"name": "cookie", "value": "test"}]) as mock_login: selenium_addon.response(f) mock_login.assert_called()