Exemple #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'",
    )
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'"),
    )
Exemple #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'",
    )
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'"),
    )
def test_parse_auth_emptystr():
    from webob.descriptors import parse_auth
    with pytest.raises(ValueError):
        parse_auth('')
def test_parse_auth_none():
    from webob.descriptors import parse_auth
    assert parse_auth(None) is None
Exemple #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'}))
Exemple #8
0
def test_parse_auth_unknown_nospace():
    from webob.descriptors import parse_auth

    assert parse_auth("NoSpace") == ("NoSpace", "")
Exemple #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"})
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'
Exemple #11
0
def test_parse_auth_none():
    from webob.descriptors import parse_auth

    assert parse_auth(None) is None
def test_parse_auth_basic():
    from webob.descriptors import parse_auth

    eq_(parse_auth("Basic realm=WebOb"), ("Basic", "realm=WebOb"))
def test_parse_auth_basic_quoted():
    from webob.descriptors import parse_auth

    eq_(parse_auth('Basic realm="Web Ob"'), ("Basic", {"realm": "Web Ob"}))
Exemple #14
0
def test_parse_auth_emptystr():
    from webob.descriptors import parse_auth
    with pytest.raises(ValueError):
        parse_auth('')
def test_parse_auth_known_nospace():
    from webob.descriptors import parse_auth
    assert parse_auth('Digest') == ('Digest', {})
def test_parse_auth_unknown_nospace():
    from webob.descriptors import parse_auth
    assert parse_auth('NoSpace') == ('NoSpace', '')
def test_parse_auth_basic():
    from webob.descriptors import parse_auth
    assert parse_auth("Basic realm=WebOb") == ('Basic', 'realm=WebOb')
Exemple #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"
def test_parse_auth_basic_quoted():
    from webob.descriptors import parse_auth
    assert parse_auth('Basic realm="Web Ob"') == ('Basic', {'realm': 'Web Ob'})
Exemple #20
0
def test_parse_auth_known_nospace():
    from webob.descriptors import parse_auth

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

    assert parse_auth("") == ("", "")
def test_parse_auth_emptystr():
    from webob.descriptors import parse_auth
    assert parse_auth('') == ('', '')
Exemple #23
0
def test_parse_auth_unknown_nospace():
    from webob.descriptors import parse_auth

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

    assert parse_auth("Basic realm=WebOb") == ("Basic", "realm=WebOb")
Exemple #26
0
def test_parse_auth_none():
    from webob.descriptors import parse_auth
    eq_(parse_auth(None), None)
Exemple #27
0
def test_parse_auth_basic():
    from webob.descriptors import parse_auth
    eq_(parse_auth("Basic realm=WebOb"), ('Basic', 'realm=WebOb'))
Exemple #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"