diff options
author | ianb <devnull@localhost> | 2007-10-10 00:59:56 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2007-10-10 00:59:56 +0000 |
commit | 83de0cc734013485f27f7b17ea6e40bf5294470e (patch) | |
tree | eb0d302ce6d71c2a18eb329e6f262bc9c8e0fc45 /tests | |
parent | e76b70a5b87811f3d6d4e928e597feee620bef1f (diff) | |
download | paste-83de0cc734013485f27f7b17ea6e40bf5294470e.tar.gz |
Added test for bad cookies; passes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_request.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_request.py b/tests/test_request.py index 7b400da..697689c 100644 --- a/tests/test_request.py +++ b/tests/test_request.py @@ -48,3 +48,14 @@ def test_mime_parsing(): res = app.get('/', headers={'Accept':'application/xml,*/*'}) assert "accepttypes is: ['text/html', 'application/xml']" in res + +def test_bad_cookie(): + env = {} + env['HTTP_COOKIE'] = '070-it-:><?0' + assert get_cookie_dict(env) == {} + env['HTTP_COOKIE'] = 'foo=bar' + assert get_cookie_dict(env) == {'foo': 'bar'} + env['HTTP_COOKIE'] = '...' + assert get_cookie_dict(env) == {} + env['HTTP_COOKIE'] = '=foo' + assert get_cookie_dict(env) == {} |