diff tests/test-wireproto-command-known.t @ 37721:f7673845b167

wireprotov2: decode responses to their expected types Callers of established wire protocol commands expect the response from that command to be decoded into a data structure. It's not very useful if callers get back a stream of bytes and don't know how they should be interpreted - especially since that stream of bytes varies by wire protocol and even the transport within that protocol version. This commit establishes decoding functions for various command responses so callers of those commands get the response type they expect. In theory, this should make the version 2 HTTP peer usable for various operations. But I haven't tested to confirm. Differential Revision: https://phab.mercurial-scm.org/D3381
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 14 Apr 2018 11:49:06 -0700
parents a656cba08a04
children 89a16704114c
line wrap: on
line diff
--- a/tests/test-wireproto-command-known.t	Sat Apr 14 11:46:08 2018 -0700
+++ b/tests/test-wireproto-command-known.t	Sat Apr 14 11:49:06 2018 -0700
@@ -50,7 +50,7 @@
   received frame(size=1; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
   s>     0\r\n
   s>     \r\n
-  response: [b'']
+  response: []
 
 Single known node works
 
@@ -83,7 +83,7 @@
   received frame(size=2; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
   s>     0\r\n
   s>     \r\n
-  response: [b'1']
+  response: [True]
 
 Multiple nodes works
 
@@ -116,6 +116,6 @@
   received frame(size=4; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
   s>     0\r\n
   s>     \r\n
-  response: [b'101']
+  response: [True, False, True]
 
   $ cat error.log