summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Bicking <ian@ianbicking.org>2007-10-10 00:59:56 +0000
committerIan Bicking <ian@ianbicking.org>2007-10-10 00:59:56 +0000
commit2f0956d4ebccbc03c7b26887b93fb57d31c4799a (patch)
treeeb0d302ce6d71c2a18eb329e6f262bc9c8e0fc45
parentded4add50199e71b9f449a476c81b095efbf26bf (diff)
downloadpaste-git-2f0956d4ebccbc03c7b26887b93fb57d31c4799a.tar.gz
Added test for bad cookies; passes
-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) == {}