mitmproxy/test/test_authentication.py

19 lines
545 B
Python
Raw Normal View History

from libmproxy import authentication
from netlib import odict
class TestNullProxyAuth:
def test_simple(self):
na = authentication.NullProxyAuth(authentication.PermissivePasswordManager())
assert not na.auth_challenge_headers()
assert na.authenticate("foo")
class TestBasicProxyAuth:
def test_simple(self):
ba = authentication.BasicProxyAuth(authentication.PermissivePasswordManager())
h = odict.ODictCaseless()
assert ba.auth_challenge_headers()
assert not ba.authenticate(h)