diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-09-20 20:35:45 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-09-20 20:35:45 +0200 |
commit | daebd1bd275a398d42cc4dbfe5c6399c7fe3b3a0 (patch) | |
tree | 5dcc3f742539b6cfd6f3dc18b53c310c37bbf291 /test/http/test_authentication.py | |
parent | 292a0aa9e671748f0ad77a5e8f8f21d40314b030 (diff) | |
download | mitmproxy-daebd1bd275a398d42cc4dbfe5c6399c7fe3b3a0.tar.gz mitmproxy-daebd1bd275a398d42cc4dbfe5c6399c7fe3b3a0.tar.bz2 mitmproxy-daebd1bd275a398d42cc4dbfe5c6399c7fe3b3a0.zip |
python3++
Diffstat (limited to 'test/http/test_authentication.py')
-rw-r--r-- | test/http/test_authentication.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/http/test_authentication.py b/test/http/test_authentication.py index ee192dd7..a2aa774a 100644 --- a/test/http/test_authentication.py +++ b/test/http/test_authentication.py @@ -11,7 +11,7 @@ def test_parse_http_basic_auth(): ) == vals assert not authentication.parse_http_basic_auth("") assert not authentication.parse_http_basic_auth("foo bar") - v = "basic " + binascii.b2a_base64("foo") + v = b"basic " + binascii.b2a_base64(b"foo") assert not authentication.parse_http_basic_auth(v) @@ -34,7 +34,7 @@ class TestPassManHtpasswd: def test_simple(self): pm = authentication.PassManHtpasswd(tutils.test_data.path("data/htpasswd")) - vals = ("basic", "test", "test") + vals = (b"basic", b"test", b"test") authentication.assemble_http_basic_auth(*vals) assert pm.test("test", "test") assert not pm.test("test", "foo") @@ -73,7 +73,7 @@ class TestBasicProxyAuth: ba = authentication.BasicProxyAuth(authentication.PassManNonAnon(), "test") headers = Headers() - vals = ("basic", "foo", "bar") + vals = (b"basic", b"foo", b"bar") headers[ba.AUTH_HEADER] = authentication.assemble_http_basic_auth(*vals) assert ba.authenticate(headers) @@ -86,12 +86,12 @@ class TestBasicProxyAuth: headers[ba.AUTH_HEADER] = "foo" assert not ba.authenticate(headers) - vals = ("foo", "foo", "bar") + vals = (b"foo", b"foo", b"bar") headers[ba.AUTH_HEADER] = authentication.assemble_http_basic_auth(*vals) assert not ba.authenticate(headers) ba = authentication.BasicProxyAuth(authentication.PassMan(), "test") - vals = ("basic", "foo", "bar") + vals = (b"basic", b"foo", b"bar") headers[ba.AUTH_HEADER] = authentication.assemble_http_basic_auth(*vals) assert not ba.authenticate(headers) |