tests/test-wireproto.py
changeset 36074 2f7290555c96
parent 33806 dedab036215d
child 36555 c28de190e20a
--- a/tests/test-wireproto.py	Wed Feb 07 16:29:05 2018 -0800
+++ b/tests/test-wireproto.py	Wed Feb 07 20:27:36 2018 -0800
@@ -1,8 +1,10 @@
 from __future__ import absolute_import, print_function
 
 from mercurial import (
+    error,
     util,
     wireproto,
+    wireprototypes,
 )
 stringio = util.stringio
 
@@ -42,7 +44,13 @@
         return ['batch']
 
     def _call(self, cmd, **args):
-        return wireproto.dispatch(self.serverrepo, proto(args), cmd)
+        res = wireproto.dispatch(self.serverrepo, proto(args), cmd)
+        if isinstance(res, wireprototypes.bytesresponse):
+            return res.data
+        elif isinstance(res, bytes):
+            return res
+        else:
+            raise error.Abort('dummy client does not support response type')
 
     def _callstream(self, cmd, **args):
         return stringio(self._call(cmd, **args))