aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorCharles d'Hondt <charles.dhondt@gmail.com>2017-05-04 13:39:48 +0200
committerCharles d'Hondt <charles.dhondt@gmail.com>2017-05-04 13:39:48 +0200
commit154e8ac0fc1b1553beaba2a73de1130e681a61c0 (patch)
tree61ff4a1f7d9b6da1ccf4a21810d8573df7ee2e47 /test
parentf67d9adc314c7723c1d3be3733dbe1ae2495b86b (diff)
downloadmitmproxy-154e8ac0fc1b1553beaba2a73de1130e681a61c0.tar.gz
mitmproxy-154e8ac0fc1b1553beaba2a73de1130e681a61c0.tar.bz2
mitmproxy-154e8ac0fc1b1553beaba2a73de1130e681a61c0.zip
fixed lint
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/addons/test_proxyauth.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/mitmproxy/addons/test_proxyauth.py b/test/mitmproxy/addons/test_proxyauth.py
index fa02d119..58e059ad 100644
--- a/test/mitmproxy/addons/test_proxyauth.py
+++ b/test/mitmproxy/addons/test_proxyauth.py
@@ -2,7 +2,6 @@ import binascii
import ldap3
import pytest
-from _pytest.monkeypatch import MonkeyPatch
from mitmproxy import exceptions
from mitmproxy.addons import proxyauth
@@ -46,7 +45,6 @@ def test_configure():
ctx.configure(up, proxyauth="ldap:fake_server:fake_dn:fake_group")
assert up.ldapserver
-
ctx.configure(up, proxyauth="ldap:fake_server:uid=?,dc=example,dc=com:person")
assert up.ldapserver
ctx.configure(up, proxyauth="ldaps:fake_server.com:uid=?,dc=example,dc=com:person")
@@ -126,7 +124,6 @@ def test_check(monkeypatch):
)
assert not up.check(f)
-
ctx.configure(
up,
proxyauth="ldap:fake-server:cn=?,ou=test,o=lab:test"
@@ -134,8 +131,10 @@ def test_check(monkeypatch):
conn = ldap3.Connection("fake-server", user="cn=user0,ou=test,o=lab", password="password", client_strategy=ldap3.MOCK_SYNC)
conn.bind()
conn.strategy.add_entry('cn=user0,ou=test,o=lab', {'userPassword': 'test0', 'sn': 'user0_sn', 'revision': 0, 'objectClass': 'test'})
+
def conn_mp(ldap, user, password, **kwargs):
return conn
+
monkeypatch.setattr(ldap3, "Connection", conn_mp)
f.request.headers["Proxy-Authorization"] = proxyauth.mkauth(
"user0", "test0"