Exemplo n.º 1
0
def test_parse_http_basic_auth():
    vals = ("basic", "foo", "bar")
    assert http.parse_http_basic_auth(http.assemble_http_basic_auth(*vals)) == vals
    assert not http.parse_http_basic_auth("")
    assert not http.parse_http_basic_auth("foo bar")
    v = "basic " + binascii.b2a_base64("foo")
    assert not http.parse_http_basic_auth(v)
Exemplo n.º 2
0
def test_parse_http_basic_auth():
    vals = ("basic", "foo", "bar")
    assert http.parse_http_basic_auth(
        http.assemble_http_basic_auth(*vals)) == vals
    assert not http.parse_http_basic_auth("")
    assert not http.parse_http_basic_auth("foo bar")
    v = "basic " + binascii.b2a_base64("foo")
    assert not http.parse_http_basic_auth(v)