From 018c229ae40d93f0f0987a37a33256db57cdc62c Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 31 Dec 2012 09:15:56 +1300 Subject: Start solidifying proxy authentication - Add a unit test file - Remove some extraneous methods - Change the auth API to make the authenticate method take a header object. --- test/test_authentication.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/test_authentication.py (limited to 'test') diff --git a/test/test_authentication.py b/test/test_authentication.py new file mode 100644 index 00000000..25714263 --- /dev/null +++ b/test/test_authentication.py @@ -0,0 +1,18 @@ +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) + -- cgit v1.2.3