From 154e8ac0fc1b1553beaba2a73de1130e681a61c0 Mon Sep 17 00:00:00 2001 From: Charles d'Hondt Date: Thu, 4 May 2017 13:39:48 +0200 Subject: [PATCH] fixed lint --- setup.py | 2 +- test/mitmproxy/addons/test_proxyauth.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index c8a1fe206..b75466fbc 100644 --- a/setup.py +++ b/setup.py @@ -71,7 +71,7 @@ setup( "hyperframe>=5.0, <6", "jsbeautifier>=1.6.3, <1.7", "kaitaistruct>=0.7, <0.8", - "ldap3>=2.2.0, <2.2.3", + "ldap3>=2.2.0, <=2.2.3", "passlib>=1.6.5, <1.8", "pyasn1>=0.1.9, <0.3", "pyOpenSSL>=16.0, <17.1", diff --git a/test/mitmproxy/addons/test_proxyauth.py b/test/mitmproxy/addons/test_proxyauth.py index fa02d119d..58e059add 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"