def test_serialize_auth_digest_multiple():
    from webob.descriptors import serialize_auth

    val = serialize_auth(("Digest", 'realm="WebOb", nonce=abcde12345, qop=foo'))
    flags = val[len("Digest") :]
    result = sorted([x.strip() for x in flags.split(",")])
    eq_(result, ["nonce=abcde12345", "qop=foo", 'realm="WebOb"'])
def test_serialize_auth_digest_tuple():
    from webob.descriptors import serialize_auth

    val = serialize_auth(("Digest", {"realm": '"WebOb"', "nonce": "abcde12345", "qop": "foo"}))
    flags = val[len("Digest") :]
    result = sorted([x.strip() for x in flags.split(",")])
    eq_(result, ['nonce="abcde12345"', 'qop="foo"', 'realm=""WebOb""'])
Exemple #3
0
def test_serialize_auth_digest_multiple():
    from webob.descriptors import serialize_auth
    val = serialize_auth(
        ('Digest', 'realm="WebOb", nonce=abcde12345, qop=foo'))
    flags = val[len('Digest'):]
    result = sorted([x.strip() for x in flags.split(',')])
    eq_(result, ['nonce=abcde12345', 'qop=foo', 'realm="WebOb"'])
Exemple #4
0
def test_serialize_auth_digest_multiple():
    from webob.descriptors import serialize_auth

    val = serialize_auth(("Digest", 'realm="WebOb", nonce=abcde12345, qop=foo'))
    flags = val[len("Digest") :]
    result = sorted([x.strip() for x in flags.split(",")])
    assert result == ["nonce=abcde12345", "qop=foo", 'realm="WebOb"']
Exemple #5
0
def test_serialize_auth_digest_tuple():
    from webob.descriptors import serialize_auth

    val = serialize_auth(
        ("Digest", {"realm": '"WebOb"', "nonce": "abcde12345", "qop": "foo"})
    )
    flags = val[len("Digest") :]
    result = sorted([x.strip() for x in flags.split(",")])
    assert result == ['nonce="abcde12345"', 'qop="foo"', 'realm=""WebOb""']
Exemple #6
0
def test_serialize_auth_digest_tuple():
    from webob.descriptors import serialize_auth
    val = serialize_auth(('Digest', {
        'realm': '"WebOb"',
        'nonce': 'abcde12345',
        'qop': 'foo'
    }))
    flags = val[len('Digest'):]
    result = sorted([x.strip() for x in flags.split(',')])
    eq_(result, ['nonce="abcde12345"', 'qop="foo"', 'realm=""WebOb""'])
Exemple #7
0
def test_serialize_auth_parsed_known_nospace():
    from webob.descriptors import serialize_auth

    assert serialize_auth(("Digest", {})) == "Digest "
Exemple #8
0
def test_serialize_auth_parsed_emptystr():
    from webob.descriptors import serialize_auth

    assert serialize_auth(("", "")) == " "
Exemple #9
0
def test_serialize_auth_emptystr():
    from webob.descriptors import serialize_auth

    assert serialize_auth("") == ""
def test_serialize_auth_digest_tuple():
    from webob.descriptors import serialize_auth
    val = serialize_auth(('Digest', {'realm':'"WebOb"', 'nonce':'abcde12345', 'qop':'foo'}))
    flags = val[len('Digest'):]
    result = sorted([ x.strip() for x in flags.split(',') ])
    assert result == ['nonce="abcde12345"', 'qop="foo"', 'realm=""WebOb""']
def test_serialize_auth_basic_quoted():
    from webob.descriptors import serialize_auth
    val = serialize_auth(('Basic', 'realm="WebOb"'))
    assert val == 'Basic realm="WebOb"'
def test_serialize_auth_none():
    from webob.descriptors import serialize_auth
    assert serialize_auth(None) is None
def test_serialize_auth_basic_quoted():
    from webob.descriptors import serialize_auth

    val = serialize_auth(("Basic", 'realm="WebOb"'))
    eq_(val, 'Basic realm="WebOb"')
def test_serialize_auth_parsed_known_nospace():
    from webob.descriptors import serialize_auth
    assert serialize_auth(('Digest', {})) == 'Digest '
def test_serialize_auth_parsed_unknown_nospace():
    from webob.descriptors import serialize_auth
    assert serialize_auth(('NoSpace', '')) == 'NoSpace '
def test_serialize_auth_parsed_emptystr():
    from webob.descriptors import serialize_auth
    assert serialize_auth(('', '')) == ' '
def test_serialize_auth_str():
    from webob.descriptors import serialize_auth
    assert serialize_auth('some string') == 'some string'
def test_serialize_auth_emptystr():
    from webob.descriptors import serialize_auth
    assert serialize_auth('') == ''
Exemple #19
0
def test_serialize_auth_none():
    from webob.descriptors import serialize_auth
    eq_(serialize_auth(None), None)
def test_serialize_auth_digest_multiple():
    from webob.descriptors import serialize_auth
    val = serialize_auth(('Digest', 'realm="WebOb", nonce=abcde12345, qop=foo'))
    flags = val[len('Digest'):]
    result = sorted([ x.strip() for x in flags.split(',') ])
    assert result == ['nonce=abcde12345', 'qop=foo', 'realm="WebOb"']
Exemple #21
0
def test_serialize_auth_emptystr():
    from webob.descriptors import serialize_auth
    eq_(serialize_auth(''), '')
Exemple #22
0
def test_serialize_auth_none():
    from webob.descriptors import serialize_auth

    assert serialize_auth(None) is None
Exemple #23
0
def test_serialize_auth_none():
    from webob.descriptors import serialize_auth
    eq_(serialize_auth(None), None)
Exemple #24
0
def test_serialize_auth_str():
    from webob.descriptors import serialize_auth

    assert serialize_auth("some string") == "some string"
Exemple #25
0
def test_serialize_auth_emptystr():
    from webob.descriptors import serialize_auth
    eq_(serialize_auth(''), '')
Exemple #26
0
def test_serialize_auth_parsed_unknown_nospace():
    from webob.descriptors import serialize_auth

    assert serialize_auth(("NoSpace", "")) == "NoSpace "
Exemple #27
0
def test_serialize_auth_basic_quoted():
    from webob.descriptors import serialize_auth
    val = serialize_auth(('Basic', 'realm="WebOb"'))
    eq_(val, 'Basic realm="WebOb"')
Exemple #28
0
def test_serialize_auth_basic_quoted():
    from webob.descriptors import serialize_auth

    val = serialize_auth(("Basic", 'realm="WebOb"'))
    assert val == 'Basic realm="WebOb"'
Exemple #29
0
def test_serialize_auth_parsed_unknown_nospace():
    from webob.descriptors import serialize_auth

    assert serialize_auth(("NoSpace", "")) == "NoSpace "