diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-07-15 22:32:14 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-07-22 15:30:51 +0200 |
commit | bab6cbff1e5444aea72a188d57812130c375e0f0 (patch) | |
tree | 5b33c11cf076a099a039fa8e8494acf5b1eff07e /test/http/http1/test_protocol.py | |
parent | f50deb7b763d093a22a4d331e16465a2fb0329cf (diff) | |
download | mitmproxy-bab6cbff1e5444aea72a188d57812130c375e0f0.tar.gz mitmproxy-bab6cbff1e5444aea72a188d57812130c375e0f0.tar.bz2 mitmproxy-bab6cbff1e5444aea72a188d57812130c375e0f0.zip |
extract authentication methods from protocol
Diffstat (limited to 'test/http/http1/test_protocol.py')
-rw-r--r-- | test/http/http1/test_protocol.py | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/test/http/http1/test_protocol.py b/test/http/http1/test_protocol.py index 05e82831..d0a2ee02 100644 --- a/test/http/http1/test_protocol.py +++ b/test/http/http1/test_protocol.py @@ -71,13 +71,13 @@ def test_connection_close(): def test_get_header_tokens(): h = odict.ODictCaseless() - assert protocol.get_header_tokens(h, "foo") == [] + assert http.get_header_tokens(h, "foo") == [] h["foo"] = ["bar"] - assert protocol.get_header_tokens(h, "foo") == ["bar"] + assert http.get_header_tokens(h, "foo") == ["bar"] h["foo"] = ["bar, voing"] - assert protocol.get_header_tokens(h, "foo") == ["bar", "voing"] + assert http.get_header_tokens(h, "foo") == ["bar", "voing"] h["foo"] = ["bar, voing", "oink"] - assert protocol.get_header_tokens(h, "foo") == ["bar", "voing", "oink"] + assert http.get_header_tokens(h, "foo") == ["bar", "voing", "oink"] def test_read_http_body_request(): @@ -357,17 +357,6 @@ def test_read_response(): assert tst(data, "GET", None, include_body=False).content is None -def test_parse_http_basic_auth(): - vals = ("basic", "foo", "bar") - assert protocol.parse_http_basic_auth( - protocol.assemble_http_basic_auth(*vals) - ) == vals - assert not protocol.parse_http_basic_auth("") - assert not protocol.parse_http_basic_auth("foo bar") - v = "basic " + binascii.b2a_base64("foo") - assert not protocol.parse_http_basic_auth(v) - - def test_get_request_line(): r = cStringIO.StringIO("\nfoo") assert protocol.get_request_line(r) == "foo" |