Patchwork D2867: tests: fix test-wireproto.py to work around serverrepo() not having a ui

login
register
mail settings
Submitter phabricator
Date March 15, 2018, 2:25 p.m.
Message ID <6e4e3d325e082f7acc226435686f8c9e@localhost.localdomain>
Download mbox | patch
Permalink /patch/29535/
State Not Applicable
Headers show

Comments

phabricator - March 15, 2018, 2:25 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGbe623af5d242: tests: fix test-wireproto.py to work around serverrepo() not having a ui (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2867?vs=7045&id=7064

REVISION DETAIL
  https://phab.mercurial-scm.org/D2867

AFFECTED FILES
  tests/test-wireproto.py

CHANGE DETAILS




To: durin42, #hg-reviewers, yuja
Cc: mercurial-devel

Patch

diff --git a/tests/test-wireproto.py b/tests/test-wireproto.py
--- a/tests/test-wireproto.py
+++ b/tests/test-wireproto.py
@@ -3,6 +3,7 @@ 
 from mercurial import (
     error,
     pycompat,
+    ui as uimod,
     util,
     wireproto,
     wireprototypes,
@@ -22,12 +23,13 @@ 
         pass
 
 class clientpeer(wireproto.wirepeer):
-    def __init__(self, serverrepo):
+    def __init__(self, serverrepo, ui):
         self.serverrepo = serverrepo
+        self._ui = ui
 
     @property
     def ui(self):
-        return self.serverrepo.ui
+        return self._ui
 
     def url(self):
         return b'test'
@@ -84,7 +86,7 @@ 
 wireproto.commands[b'greet'] = (greet, b'name',)
 
 srv = serverrepo()
-clt = clientpeer(srv)
+clt = clientpeer(srv, uimod.ui())
 
 print(clt.greet(b"Foobar"))
 b = clt.iterbatch()