mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 08:11:00 +00:00
19 lines
545 B
Python
19 lines
545 B
Python
|
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)
|
||
|
|