comparison tests/test-hgweb-no-path-info.t @ 18646:c6a81e54c209

hgweb: make the test suite use hgweb in a more WSGI compliant way - as checked by wsgiref.validate. This makes sure that we don't optimize hgweb for invalid use cases.
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 27 Jan 2013 03:32:09 +0100
parents f2719b387380
children d70703954a2a
comparison
equal deleted inserted replaced
18645:76ff3a715cf2 18646:c6a81e54c209
37 > 'wsgi.input': input, 37 > 'wsgi.input': input,
38 > 'wsgi.multithread': False, 38 > 'wsgi.multithread': False,
39 > 'wsgi.multiprocess': False, 39 > 'wsgi.multiprocess': False,
40 > 'wsgi.run_once': False, 40 > 'wsgi.run_once': False,
41 > 'REQUEST_METHOD': 'GET', 41 > 'REQUEST_METHOD': 'GET',
42 > 'PATH_INFO': '/',
42 > 'SCRIPT_NAME': '', 43 > 'SCRIPT_NAME': '',
43 > 'SERVER_NAME': '127.0.0.1', 44 > 'SERVER_NAME': '127.0.0.1',
44 > 'SERVER_PORT': os.environ['HGPORT'], 45 > 'SERVER_PORT': os.environ['HGPORT'],
45 > 'SERVER_PROTOCOL': 'HTTP/1.0' 46 > 'SERVER_PROTOCOL': 'HTTP/1.0'
46 > } 47 > }
47 > 48 >
48 > def process(app): 49 > def process(app):
49 > content = app(env, startrsp) 50 > content = app(env, startrsp)
50 > sys.stdout.write(output.getvalue()) 51 > sys.stdout.write(output.getvalue())
51 > sys.stdout.write(''.join(content)) 52 > sys.stdout.write(''.join(content))
53 > getattr(content, 'close', lambda : None)()
52 > print '---- ERRORS' 54 > print '---- ERRORS'
53 > print errors.getvalue() 55 > print errors.getvalue()
54 > 56 >
55 > output = StringIO() 57 > output = StringIO()
56 > env['QUERY_STRING'] = 'style=atom' 58 > env['QUERY_STRING'] = 'style=atom'
99 200 Script output follows 101 200 Script output follows
100 ---- HEADERS 102 ---- HEADERS
101 [('Content-Type', 'text/plain; charset=ascii')] 103 [('Content-Type', 'text/plain; charset=ascii')]
102 ---- DATA 104 ---- DATA
103 105
104 repo/ 106 /repo/
105 107
106 ---- ERRORS 108 ---- ERRORS
107 109
108 110
109 $ cd .. 111 $ cd ..