def test_parse_auth_params_bad_whitespace(): from webob.descriptors import parse_auth_params assert parse_auth_params('a= "2 ", b =3, c=4 ') == { 'a': '2 ', 'b': '3', 'c': '4' }
def test_authorization2(): from webob.descriptors import parse_auth_params for s, d in [ ('x=y', { 'x': 'y' }), ('x="y"', { 'x': 'y' }), ('x=y,z=z', { 'x': 'y', 'z': 'z' }), ('x=y, z=z', { 'x': 'y', 'z': 'z' }), ('x="y",z=z', { 'x': 'y', 'z': 'z' }), ('x="y", z=z', { 'x': 'y', 'z': 'z' }), ('x="y,x", z=z', { 'x': 'y,x', 'z': 'z' }), ]: assert parse_auth_params(s) == d
def test_authorization2(): from webob.descriptors import parse_auth_params for s, d in [ ("x=y", { "x": "y" }), ('x="y"', { "x": "y" }), ("x=y,z=z", { "x": "y", "z": "z" }), ("x=y, z=z", { "x": "y", "z": "z" }), ('x="y",z=z', { "x": "y", "z": "z" }), ('x="y", z=z', { "x": "y", "z": "z" }), ('x="y,x", z=z', { "x": "y,x", "z": "z" }), ]: assert parse_auth_params(s) == d
def test_parse_auth_params_multiple_values(): from webob.descriptors import parse_auth_params val = parse_auth_params("foo='blah &&234', qop=foo, nonce='qwerty1234'") assert val == { 'nonce': "'qwerty1234'", 'foo': "'blah &&234'", 'qop': 'foo' }
def test_parse_auth_params_bad_whitespace(): from webob.descriptors import parse_auth_params assert parse_auth_params('a= "2 ", b =3, c=4 ') == { "a": "2 ", "b": "3", "c": "4" }
def test_parse_auth_params_multiple_values(): from webob.descriptors import parse_auth_params val = parse_auth_params("foo='blah &&234', qop=foo, nonce='qwerty1234'") assert val == { "nonce": "'qwerty1234'", "foo": "'blah &&234'", "qop": "foo" }
def test_authorization2(): from webob.descriptors import parse_auth_params for s, d in [ ('x=y', {'x': 'y'}), ('x="y"', {'x': 'y'}), ('x=y,z=z', {'x': 'y', 'z': 'z'}), ('x=y, z=z', {'x': 'y', 'z': 'z'}), ('x="y",z=z', {'x': 'y', 'z': 'z'}), ('x="y", z=z', {'x': 'y', 'z': 'z'}), ('x="y,x", z=z', {'x': 'y,x', 'z': 'z'}), ]: assert parse_auth_params(s) == d
def test_authorization2(): from webob.descriptors import parse_auth_params for s, d in [ ("x=y", {"x": "y"}), ('x="y"', {"x": "y"}), ("x=y,z=z", {"x": "y", "z": "z"}), ("x=y, z=z", {"x": "y", "z": "z"}), ('x="y",z=z', {"x": "y", "z": "z"}), ('x="y", z=z', {"x": "y", "z": "z"}), ('x="y,x", z=z', {"x": "y,x", "z": "z"}), ]: eq_(parse_auth_params(s), d)
def test_parse_auth_params_truncate_on_comma(): from webob.descriptors import parse_auth_params val = parse_auth_params("Basic realm=WebOb,this_will_truncate") eq_(val, {'realm': 'WebOb'})
def test_parse_auth_params_leading_capital_letter(): from webob.descriptors import parse_auth_params val = parse_auth_params("Basic Realm=WebOb") eq_(val, {"ealm": "WebOb"})
def test_parse_auth_params_emptystr(): from webob.descriptors import parse_auth_params assert parse_auth_params('') == {}
def test_parse_auth_params_truncate_on_comma(): from webob.descriptors import parse_auth_params val = parse_auth_params("Basic realm=WebOb,this_will_truncate") assert val == {'realm': 'WebOb'}
def test_parse_auth_params_multiple_values(): from webob.descriptors import parse_auth_params val = parse_auth_params("foo='blah &&234', qop=foo, nonce='qwerty1234'") assert val == {'nonce': "'qwerty1234'", 'foo': "'blah &&234'", 'qop': 'foo'}
def test_parse_auth_params_multiple_values(): from webob.descriptors import parse_auth_params val = parse_auth_params("foo='blah &&234', qop=foo, nonce='qwerty1234'") eq_(val, {"nonce": "'qwerty1234'", "foo": "'blah &&234'", "qop": "foo"})
def test_parse_auth_params_truncate_on_comma(): from webob.descriptors import parse_auth_params val = parse_auth_params("Basic realm=WebOb,this_will_truncate") eq_(val, {"realm": "WebOb"})
def test_parse_auth_params_truncate_on_comma(): from webob.descriptors import parse_auth_params val = parse_auth_params("Basic realm=WebOb,this_will_truncate") assert val == {"realm": "WebOb"}
def test_parse_auth_params_doublequotes(): from webob.descriptors import parse_auth_params val = parse_auth_params('Basic realm="Web Object"') assert val == {"realm": "Web Object"}
def test_parse_auth_params_leading_capital_letter(): from webob.descriptors import parse_auth_params val = parse_auth_params("Basic Realm=WebOb") assert val == {"ealm": "WebOb"}
def test_parse_auth_params_doublequotes(): from webob.descriptors import parse_auth_params val = parse_auth_params('Basic realm="Web Object"') eq_(val, {'realm': 'Web Object'})
def test_parse_auth_params_trailing_capital_letter(): from webob.descriptors import parse_auth_params val = parse_auth_params('Basic realM=WebOb') eq_(val, {})
def test_parse_auth_params_leading_capital_letter(): from webob.descriptors import parse_auth_params val = parse_auth_params('Basic Realm=WebOb') eq_(val, {'ealm': 'WebOb'})
def test_parse_auth_params_emptystr(): from webob.descriptors import parse_auth_params eq_(parse_auth_params(''), {})
def test_parse_auth_params_bad_whitespace(): from webob.descriptors import parse_auth_params eq_(parse_auth_params('a= "2 ", b =3, c=4 '), {"a": "2 ", "b": "3", "c": "4"})
def test_parse_auth_params_trailing_capital_letter(): from webob.descriptors import parse_auth_params val = parse_auth_params("Basic realM=WebOb") assert val == {}
def test_parse_auth_params_trailing_capital_letter(): from webob.descriptors import parse_auth_params val = parse_auth_params("Basic realM=WebOb") eq_(val, {})
def test_parse_auth_params_trailing_capital_letter(): from webob.descriptors import parse_auth_params val = parse_auth_params('Basic realM=WebOb') assert val == {}
def test_parse_auth_params_emptystr(): from webob.descriptors import parse_auth_params assert parse_auth_params("") == {}
def test_parse_auth_params_doublequotes(): from webob.descriptors import parse_auth_params val = parse_auth_params('Basic realm="Web Object"') assert val == {'realm': 'Web Object'}
def test_parse_auth_params_leading_capital_letter(): from webob.descriptors import parse_auth_params val = parse_auth_params('Basic Realm=WebOb') assert val == {'ealm': 'WebOb'}
def test_parse_auth_params_doublequotes(): from webob.descriptors import parse_auth_params val = parse_auth_params('Basic realm="Web Object"') eq_(val, {"realm": "Web Object"})