diff options
author | Ian Bicking <ian@ianbicking.org> | 2007-10-10 00:59:56 +0000 |
---|---|---|
committer | Ian Bicking <ian@ianbicking.org> | 2007-10-10 00:59:56 +0000 |
commit | 2f0956d4ebccbc03c7b26887b93fb57d31c4799a (patch) | |
tree | eb0d302ce6d71c2a18eb329e6f262bc9c8e0fc45 | |
parent | ded4add50199e71b9f449a476c81b095efbf26bf (diff) | |
download | paste-git-2f0956d4ebccbc03c7b26887b93fb57d31c4799a.tar.gz |
Added test for bad cookies; passes
-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) == {} |