forked from notmyname/python_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webob_date_test.py
executable file
·36 lines (34 loc) · 1.25 KB
/
webob_date_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python
from webob import Request, Response
import os
class App(object):
def __call__(self, environ, start_response):
res = Response(conditional_response=True)
res.body = ''.join(str(i) for i in xrange(10))
res.content_length = 10
return res(environ, start_response)
for d in ['Wed, 31 Dec 1970 09:59:59 GMT',
'Wed, 31 Dec 1970 08:59:59 GMT',
'Wed, 31 Dec 1970 07:59:59 GMT',
'Wed, 31 Dec 1970 06:59:59 GMT',
'Wed, 31 Dec 1970 05:59:59 GMT',
'Wed, 31 Dec 1970 04:59:59 GMT',
'Wed, 31 Dec 1970 03:59:59 GMT',
'Wed, 31 Dec 1970 02:59:59 GMT',
'Wed, 31 Dec 1970 01:59:59 GMT',
'Wed, 31 Dec 1970 00:59:59 GMT',
'Wed, 31 Dec 1969 23:59:59 GMT',
'Wed, 31 Dec 1969 22:59:59 GMT',
'Wed, 31 Dec 1969 21:59:59 GMT',
'Wed, 31 Dec 1969 20:59:59 GMT',
'Wed, 31 Dec 1969 19:59:59 GMT',
'Wed, 31 Dec 1969 18:59:59 GMT',
'Wed, 31 Dec 1969 17:59:59 GMT',
'Wed, 31 Dec 1969 16:59:59 GMT',
'Wed, 31 Dec 1969 15:59:59 GMT',
'Wed, 31 Dec 1969 14:59:59 GMT']:
req = Request.blank('/')
req.headers['If-Unmodified-Since'] = d
print req
print '-'*30
print req.get_response(App())