##// END OF EJS Templates
py3: use print_function in test-batching.py
Robert Stanca -
r28732:e2b11859 default
parent child Browse files
Show More
@@ -5,7 +5,7 b''
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import, print_function
9 from mercurial.peer import (
9 from mercurial.peer import (
10 localbatch,
10 localbatch,
11 batchable,
11 batchable,
@@ -38,11 +38,11 b' class localthing(thing):'
38 def use(it):
38 def use(it):
39
39
40 # Direct call to base method shared between client and server.
40 # Direct call to base method shared between client and server.
41 print it.hello()
41 print(it.hello())
42
42
43 # Direct calls to proxied methods. They cause individual roundtrips.
43 # Direct calls to proxied methods. They cause individual roundtrips.
44 print it.foo("Un", two="Deux")
44 print(it.foo("Un", two="Deux"))
45 print it.bar("Eins", "Zwei")
45 print(it.bar("Eins", "Zwei"))
46
46
47 # Batched call to a couple of (possibly proxied) methods.
47 # Batched call to a couple of (possibly proxied) methods.
48 batch = it.batch()
48 batch = it.batch()
@@ -60,17 +60,17 b' def use(it):'
60 # as possible.
60 # as possible.
61 batch.submit()
61 batch.submit()
62 # After the call to submit, the futures actually contain values.
62 # After the call to submit, the futures actually contain values.
63 print foo.value
63 print(foo.value)
64 print foo2.value
64 print(foo2.value)
65 print bar.value
65 print(bar.value)
66 print greet.value
66 print(greet.value)
67 print hello.value
67 print(hello.value)
68 print bar2.value
68 print(bar2.value)
69
69
70 # local usage
70 # local usage
71 mylocal = localthing()
71 mylocal = localthing()
72 print
72 print()
73 print "== Local"
73 print("== Local")
74 use(mylocal)
74 use(mylocal)
75
75
76 # demo remoting; mimicks what wireproto and HTTP/SSH do
76 # demo remoting; mimicks what wireproto and HTTP/SSH do
@@ -100,12 +100,12 b' class server(object):'
100 args = dict(arg.split('=', 1) for arg in args)
100 args = dict(arg.split('=', 1) for arg in args)
101 return getattr(self, name)(**args)
101 return getattr(self, name)(**args)
102 def perform(self, req):
102 def perform(self, req):
103 print "REQ:", req
103 print("REQ:", req)
104 name, args = req.split('?', 1)
104 name, args = req.split('?', 1)
105 args = args.split('&')
105 args = args.split('&')
106 vals = dict(arg.split('=', 1) for arg in args)
106 vals = dict(arg.split('=', 1) for arg in args)
107 res = getattr(self, name)(**vals)
107 res = getattr(self, name)(**vals)
108 print " ->", res
108 print(" ->", res)
109 return res
109 return res
110 def batch(self, cmds):
110 def batch(self, cmds):
111 res = []
111 res = []
@@ -178,6 +178,6 b' class remotething(thing):'
178 # demo remote usage
178 # demo remote usage
179
179
180 myproxy = remotething(myserver)
180 myproxy = remotething(myserver)
181 print
181 print()
182 print "== Remote"
182 print("== Remote")
183 use(myproxy)
183 use(myproxy)
@@ -53,7 +53,6 b''
53 tests/svn-safe-append.py not using absolute_import
53 tests/svn-safe-append.py not using absolute_import
54 tests/svnxml.py not using absolute_import
54 tests/svnxml.py not using absolute_import
55 tests/test-atomictempfile.py not using absolute_import
55 tests/test-atomictempfile.py not using absolute_import
56 tests/test-batching.py requires print_function
57 tests/test-bdiff.py not using absolute_import
56 tests/test-bdiff.py not using absolute_import
58 tests/test-bdiff.py requires print_function
57 tests/test-bdiff.py requires print_function
59 tests/test-context.py not using absolute_import
58 tests/test-context.py not using absolute_import
@@ -252,7 +251,6 b''
252 mercurial/windows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob)
251 mercurial/windows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob)
253 mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
252 mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
254 tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
253 tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
255 tests/test-batching.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
256 tests/test-bdiff.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
254 tests/test-bdiff.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
257 tests/test-context.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
255 tests/test-context.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
258 tests/test-demandimport.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
256 tests/test-demandimport.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
General Comments 0
You need to be logged in to leave comments. Login now