mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 16:17:49 +00:00
018c229ae4
- Add a unit test file - Remove some extraneous methods - Change the auth API to make the authenticate method take a header object.
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)
|
|
|