##// END OF EJS Templates
tests: fix test-wireproto.py to work around serverrepo() not having a ui...
Augie Fackler -
r36962:65615c29 default
parent child Browse files
Show More
@@ -3,6 +3,7 b' from __future__ import absolute_import, '
3 from mercurial import (
3 from mercurial import (
4 error,
4 error,
5 pycompat,
5 pycompat,
6 ui as uimod,
6 util,
7 util,
7 wireproto,
8 wireproto,
8 wireprototypes,
9 wireprototypes,
@@ -22,12 +23,13 b' class proto(object):'
22 pass
23 pass
23
24
24 class clientpeer(wireproto.wirepeer):
25 class clientpeer(wireproto.wirepeer):
25 def __init__(self, serverrepo):
26 def __init__(self, serverrepo, ui):
26 self.serverrepo = serverrepo
27 self.serverrepo = serverrepo
28 self._ui = ui
27
29
28 @property
30 @property
29 def ui(self):
31 def ui(self):
30 return self.serverrepo.ui
32 return self._ui
31
33
32 def url(self):
34 def url(self):
33 return b'test'
35 return b'test'
@@ -84,7 +86,7 b' def greet(repo, proto, name):'
84 wireproto.commands[b'greet'] = (greet, b'name',)
86 wireproto.commands[b'greet'] = (greet, b'name',)
85
87
86 srv = serverrepo()
88 srv = serverrepo()
87 clt = clientpeer(srv)
89 clt = clientpeer(srv, uimod.ui())
88
90
89 print(clt.greet(b"Foobar"))
91 print(clt.greet(b"Foobar"))
90 b = clt.iterbatch()
92 b = clt.iterbatch()
General Comments 0
You need to be logged in to leave comments. Login now