diff tests/test-wireproto.py @ 33806:dedab036215d

wireproto: use new peer interface The wirepeer class provides concrete implementations of peer interface methods for calling wire protocol commands. It makes sense for this class to inherit from the peer abstract base class. So we change that. Since httppeer and sshpeer have already been converted to the new interface, peerrepository is no longer adding any value. So it has been removed. httppeer and sshpeer have been updated to reflect the loss of peerrepository and the inheritance of the abstract base class in wirepeer. The code changes in wirepeer are reordering of methods to group by interface. Some Python code in tests was updated to reflect changed APIs. .. api:: peer.peerrepository has been removed. Use repository.peer abstract base class to represent a peer repository. Differential Revision: https://phab.mercurial-scm.org/D338
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 10 Aug 2017 20:58:28 -0700
parents b47fe9733d76
children 2f7290555c96
line wrap: on
line diff
--- a/tests/test-wireproto.py	Sun Aug 06 18:00:19 2017 -0700
+++ b/tests/test-wireproto.py	Thu Aug 10 20:58:28 2017 -0700
@@ -19,7 +19,26 @@
     def __init__(self, serverrepo):
         self.serverrepo = serverrepo
 
-    def _capabilities(self):
+    @property
+    def ui(self):
+        return self.serverrepo.ui
+
+    def url(self):
+        return 'test'
+
+    def local(self):
+        return None
+
+    def peer(self):
+        return self
+
+    def canpush(self):
+        return True
+
+    def close(self):
+        pass
+
+    def capabilities(self):
         return ['batch']
 
     def _call(self, cmd, **args):