##// END OF EJS Templates
tests: just use 'response.reason'...
Pierre-Yves David -
r25208:5a6820f8 default
parent child Browse files
Show More
@@ -33,8 +33,6 b" if '--json' in sys.argv:"
33 sys.argv.remove('--json')
33 sys.argv.remove('--json')
34 formatjson = True
34 formatjson = True
35
35
36 reasons = {'Not modified': 'Not Modified'} # python 2.4
37
38 tag = None
36 tag = None
39 def request(host, path, show):
37 def request(host, path, show):
40 assert not path.startswith('/'), path
38 assert not path.startswith('/'), path
@@ -46,7 +44,7 b' def request(host, path, show):'
46 conn = httplib.HTTPConnection(host)
44 conn = httplib.HTTPConnection(host)
47 conn.request("GET", '/' + path, None, headers)
45 conn.request("GET", '/' + path, None, headers)
48 response = conn.getresponse()
46 response = conn.getresponse()
49 print response.status, reasons.get(response.reason, response.reason)
47 print response.status, response.reason
50 if show[:1] == ['-']:
48 if show[:1] == ['-']:
51 show = sorted(h for h, v in response.getheaders()
49 show = sorted(h for h, v in response.getheaders()
52 if h.lower() not in show)
50 if h.lower() not in show)
General Comments 0
You need to be logged in to leave comments. Login now