##// END OF EJS Templates
tests: fix simple heredoc print statements to work on Py3...
Augie Fackler -
r33686:27fb986e default
parent child Browse files
Show More
@@ -31,11 +31,11 b' should be used from d74fc8dec2b4 onward '
31 > input = stringio()
31 > input = stringio()
32 >
32 >
33 > def startrsp(status, headers):
33 > def startrsp(status, headers):
34 > print '---- STATUS'
34 > print('---- STATUS')
35 > print status
35 > print(status)
36 > print '---- HEADERS'
36 > print('---- HEADERS')
37 > print [i for i in headers if i[0] != 'ETag']
37 > print([i for i in headers if i[0] != 'ETag'])
38 > print '---- DATA'
38 > print('---- DATA')
39 > return output.write
39 > return output.write
40 >
40 >
41 > env = {
41 > env = {
@@ -59,8 +59,8 b' should be used from d74fc8dec2b4 onward '
59 > sys.stdout.write(output.getvalue())
59 > sys.stdout.write(output.getvalue())
60 > sys.stdout.write(''.join(content))
60 > sys.stdout.write(''.join(content))
61 > getattr(content, 'close', lambda : None)()
61 > getattr(content, 'close', lambda : None)()
62 > print '---- ERRORS'
62 > print('---- ERRORS')
63 > print errors.getvalue()
63 > print(errors.getvalue())
64 >
64 >
65 > output = stringio()
65 > output = stringio()
66 > env['QUERY_STRING'] = 'style=atom'
66 > env['QUERY_STRING'] = 'style=atom'
@@ -31,11 +31,11 b' should be used from d74fc8dec2b4 onward '
31 > input = stringio()
31 > input = stringio()
32 >
32 >
33 > def startrsp(status, headers):
33 > def startrsp(status, headers):
34 > print '---- STATUS'
34 > print('---- STATUS')
35 > print status
35 > print(status)
36 > print '---- HEADERS'
36 > print('---- HEADERS')
37 > print [i for i in headers if i[0] != 'ETag']
37 > print([i for i in headers if i[0] != 'ETag'])
38 > print '---- DATA'
38 > print('---- DATA')
39 > return output.write
39 > return output.write
40 >
40 >
41 > env = {
41 > env = {
@@ -58,8 +58,8 b' should be used from d74fc8dec2b4 onward '
58 > sys.stdout.write(output.getvalue())
58 > sys.stdout.write(output.getvalue())
59 > sys.stdout.write(''.join(content))
59 > sys.stdout.write(''.join(content))
60 > getattr(content, 'close', lambda : None)()
60 > getattr(content, 'close', lambda : None)()
61 > print '---- ERRORS'
61 > print('---- ERRORS')
62 > print errors.getvalue()
62 > print(errors.getvalue())
63 >
63 >
64 > output = stringio()
64 > output = stringio()
65 > env['PATH_INFO'] = '/'
65 > env['PATH_INFO'] = '/'
@@ -41,11 +41,11 b' by the WSGI standard and strictly implem'
41 > output = stringio()
41 > output = stringio()
42 >
42 >
43 > def startrsp(status, headers):
43 > def startrsp(status, headers):
44 > print '---- STATUS'
44 > print('---- STATUS')
45 > print status
45 > print(status)
46 > print '---- HEADERS'
46 > print('---- HEADERS')
47 > print [i for i in headers if i[0] != 'ETag']
47 > print([i for i in headers if i[0] != 'ETag'])
48 > print '---- DATA'
48 > print('---- DATA')
49 > return output.write
49 > return output.write
50 >
50 >
51 > env = {
51 > env = {
@@ -68,13 +68,13 b' by the WSGI standard and strictly implem'
68 > i = hgweb('.')
68 > i = hgweb('.')
69 > for c in i(env, startrsp):
69 > for c in i(env, startrsp):
70 > pass
70 > pass
71 > print '---- ERRORS'
71 > print('---- ERRORS')
72 > print errors.getvalue()
72 > print(errors.getvalue())
73 > print '---- OS.ENVIRON wsgi variables'
73 > print('---- OS.ENVIRON wsgi variables')
74 > print sorted([x for x in os.environ if x.startswith('wsgi')])
74 > print(sorted([x for x in os.environ if x.startswith('wsgi')]))
75 > print '---- request.ENVIRON wsgi variables'
75 > print('---- request.ENVIRON wsgi variables')
76 > with i._obtainrepo() as repo:
76 > with i._obtainrepo() as repo:
77 > print sorted([x for x in repo.ui.environ if x.startswith('wsgi')])
77 > print(sorted([x for x in repo.ui.environ if x.startswith('wsgi')]))
78 > EOF
78 > EOF
79 $ $PYTHON request.py
79 $ $PYTHON request.py
80 ---- STATUS
80 ---- STATUS
@@ -4,7 +4,7 b''
4 > import sys
4 > import sys
5 > for entry in sys.stdin.read().split('\n'):
5 > for entry in sys.stdin.read().split('\n'):
6 > if entry:
6 > if entry:
7 > print entry.split('\x00')[0]
7 > print(entry.split('\x00')[0])
8 > EOF
8 > EOF
9
9
10 $ echo "[extensions]" >> $HGRCPATH
10 $ echo "[extensions]" >> $HGRCPATH
General Comments 0
You need to be logged in to leave comments. Login now