Ejemplo n.º 1
0
def test_parse_auth_basic_quoted_known_multiple():
    from webob.descriptors import parse_auth

    assert parse_auth("Basic realm='blah &&234', qop=foo, nonce='qwerty1234'") == (
        "Basic",
        "realm='blah &&234', qop=foo, nonce='qwerty1234'",
    )
Ejemplo n.º 2
0
def test_parse_auth_basic_quoted_known_multiple():
    from webob.descriptors import parse_auth

    eq_(
        parse_auth("Basic realm='blah &&234', qop=foo, nonce='qwerty1234'"),
        ("Basic", "realm='blah &&234', qop=foo, nonce='qwerty1234'"),
    )
Ejemplo n.º 3
0
def test_parse_auth_basic_quoted_multiple_unknown():
    from webob.descriptors import parse_auth

    assert parse_auth("foo='blah &&234', qop=foo, nonce='qwerty1234'") == (
        "foo='blah",
        "&&234', qop=foo, nonce='qwerty1234'",
    )
Ejemplo n.º 4
0
def test_parse_auth_basic_quoted_multiple_unknown():
    from webob.descriptors import parse_auth

    eq_(
        parse_auth("foo='blah &&234', qop=foo, nonce='qwerty1234'"),
        ("foo='blah", "&&234', qop=foo, nonce='qwerty1234'"),
    )
Ejemplo n.º 5
0
def test_parse_auth_emptystr():
    from webob.descriptors import parse_auth
    with pytest.raises(ValueError):
        parse_auth('')
Ejemplo n.º 6
0
def test_parse_auth_none():
    from webob.descriptors import parse_auth
    assert parse_auth(None) is None
Ejemplo n.º 7
0
def test_parse_auth_basic_quoted():
    from webob.descriptors import parse_auth
    eq_(parse_auth('Basic realm="Web Ob"'), ('Basic', {'realm': 'Web Ob'}))
Ejemplo n.º 8
0
def test_parse_auth_unknown_nospace():
    from webob.descriptors import parse_auth

    assert parse_auth("NoSpace") == ("NoSpace", "")
Ejemplo n.º 9
0
def test_parse_auth_basic_quoted():
    from webob.descriptors import parse_auth

    assert parse_auth('Basic realm="Web Ob"') == ("Basic", {"realm": "Web Ob"})
Ejemplo n.º 10
0
def test_parse_auth_bearer():
    from webob.descriptors import parse_auth
    assert parse_auth('Bearer token').authtype == 'Bearer'
    assert parse_auth('Bearer token').params == 'token'
Ejemplo n.º 11
0
def test_parse_auth_none():
    from webob.descriptors import parse_auth

    assert parse_auth(None) is None
Ejemplo n.º 12
0
def test_parse_auth_basic():
    from webob.descriptors import parse_auth

    eq_(parse_auth("Basic realm=WebOb"), ("Basic", "realm=WebOb"))
Ejemplo n.º 13
0
def test_parse_auth_basic_quoted():
    from webob.descriptors import parse_auth

    eq_(parse_auth('Basic realm="Web Ob"'), ("Basic", {"realm": "Web Ob"}))
Ejemplo n.º 14
0
def test_parse_auth_emptystr():
    from webob.descriptors import parse_auth
    with pytest.raises(ValueError):
        parse_auth('')
Ejemplo n.º 15
0
def test_parse_auth_known_nospace():
    from webob.descriptors import parse_auth
    assert parse_auth('Digest') == ('Digest', {})
Ejemplo n.º 16
0
def test_parse_auth_unknown_nospace():
    from webob.descriptors import parse_auth
    assert parse_auth('NoSpace') == ('NoSpace', '')
Ejemplo n.º 17
0
def test_parse_auth_basic():
    from webob.descriptors import parse_auth
    assert parse_auth("Basic realm=WebOb") == ('Basic', 'realm=WebOb')
Ejemplo n.º 18
0
def test_parse_auth_bearer():
    from webob.descriptors import parse_auth

    assert parse_auth("Bearer token").authtype == "Bearer"
    assert parse_auth("Bearer token").params == "token"
Ejemplo n.º 19
0
def test_parse_auth_basic_quoted():
    from webob.descriptors import parse_auth
    assert parse_auth('Basic realm="Web Ob"') == ('Basic', {'realm': 'Web Ob'})
Ejemplo n.º 20
0
def test_parse_auth_known_nospace():
    from webob.descriptors import parse_auth

    assert parse_auth("Digest") == ("Digest", {})
Ejemplo n.º 21
0
def test_parse_auth_emptystr():
    from webob.descriptors import parse_auth

    assert parse_auth("") == ("", "")
Ejemplo n.º 22
0
def test_parse_auth_emptystr():
    from webob.descriptors import parse_auth
    assert parse_auth('') == ('', '')
Ejemplo n.º 23
0
def test_parse_auth_unknown_nospace():
    from webob.descriptors import parse_auth

    assert parse_auth("NoSpace") == ("NoSpace", "")
Ejemplo n.º 24
0
def test_parse_auth_none():
    from webob.descriptors import parse_auth
    eq_(parse_auth(None), None)
Ejemplo n.º 25
0
def test_parse_auth_basic():
    from webob.descriptors import parse_auth

    assert parse_auth("Basic realm=WebOb") == ("Basic", "realm=WebOb")
Ejemplo n.º 26
0
def test_parse_auth_none():
    from webob.descriptors import parse_auth
    eq_(parse_auth(None), None)
Ejemplo n.º 27
0
def test_parse_auth_basic():
    from webob.descriptors import parse_auth
    eq_(parse_auth("Basic realm=WebOb"), ('Basic', 'realm=WebOb'))
Ejemplo n.º 28
0
def test_parse_auth_bearer():
    from webob.descriptors import parse_auth

    assert parse_auth("Bearer token").authtype == "Bearer"
    assert parse_auth("Bearer token").params == "token"