summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorianb <devnull@localhost>2007-10-10 00:59:56 +0000
committerianb <devnull@localhost>2007-10-10 00:59:56 +0000
commit83de0cc734013485f27f7b17ea6e40bf5294470e (patch)
treeeb0d302ce6d71c2a18eb329e6f262bc9c8e0fc45 /tests
parente76b70a5b87811f3d6d4e928e597feee620bef1f (diff)
downloadpaste-83de0cc734013485f27f7b17ea6e40bf5294470e.tar.gz
Added test for bad cookies; passes
Diffstat (limited to 'tests')
-rw-r--r--tests/test_request.py11
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) == {}