コード例 #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'",
    )
コード例 #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'"),
    )
コード例 #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'",
    )
コード例 #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'"),
    )
コード例 #5
0
def test_parse_auth_emptystr():
    from webob.descriptors import parse_auth
    with pytest.raises(ValueError):
        parse_auth('')
コード例 #6
0
def test_parse_auth_none():
    from webob.descriptors import parse_auth
    assert parse_auth(None) is None
コード例 #7
0
ファイル: test_descriptors.py プロジェクト: witsch/webob
def test_parse_auth_basic_quoted():
    from webob.descriptors import parse_auth
    eq_(parse_auth('Basic realm="Web Ob"'), ('Basic', {'realm': 'Web Ob'}))
コード例 #8
0
ファイル: test_descriptors.py プロジェクト: Pylons/webob
def test_parse_auth_unknown_nospace():
    from webob.descriptors import parse_auth

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

    assert parse_auth(None) is None
コード例 #12
0
def test_parse_auth_basic():
    from webob.descriptors import parse_auth

    eq_(parse_auth("Basic realm=WebOb"), ("Basic", "realm=WebOb"))
コード例 #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"}))
コード例 #14
0
def test_parse_auth_emptystr():
    from webob.descriptors import parse_auth
    with pytest.raises(ValueError):
        parse_auth('')
コード例 #15
0
def test_parse_auth_known_nospace():
    from webob.descriptors import parse_auth
    assert parse_auth('Digest') == ('Digest', {})
コード例 #16
0
def test_parse_auth_unknown_nospace():
    from webob.descriptors import parse_auth
    assert parse_auth('NoSpace') == ('NoSpace', '')
コード例 #17
0
def test_parse_auth_basic():
    from webob.descriptors import parse_auth
    assert parse_auth("Basic realm=WebOb") == ('Basic', 'realm=WebOb')
コード例 #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"
コード例 #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'})
コード例 #20
0
def test_parse_auth_known_nospace():
    from webob.descriptors import parse_auth

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

    assert parse_auth("") == ("", "")
コード例 #22
0
def test_parse_auth_emptystr():
    from webob.descriptors import parse_auth
    assert parse_auth('') == ('', '')
コード例 #23
0
def test_parse_auth_unknown_nospace():
    from webob.descriptors import parse_auth

    assert parse_auth("NoSpace") == ("NoSpace", "")
コード例 #24
0
ファイル: test_descriptors.py プロジェクト: GdZ/scriptfile
def test_parse_auth_none():
    from webob.descriptors import parse_auth
    eq_(parse_auth(None), None)
コード例 #25
0
def test_parse_auth_basic():
    from webob.descriptors import parse_auth

    assert parse_auth("Basic realm=WebOb") == ("Basic", "realm=WebOb")
コード例 #26
0
ファイル: test_descriptors.py プロジェクト: witsch/webob
def test_parse_auth_none():
    from webob.descriptors import parse_auth
    eq_(parse_auth(None), None)
コード例 #27
0
ファイル: test_descriptors.py プロジェクト: witsch/webob
def test_parse_auth_basic():
    from webob.descriptors import parse_auth
    eq_(parse_auth("Basic realm=WebOb"), ('Basic', 'realm=WebOb'))
コード例 #28
0
ファイル: test_descriptors.py プロジェクト: Pylons/webob
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"