diff tests/test-wireproto-serverreactor.py @ 37726:0c184ca594bb

wireprotov2: change behavior of error frame Now that we have a leading CBOR map in command response frames to indicate overall command result status, we don't need to use the error response frame to represent command errors. Instead, we can reserve it for protocol and server level errors. And for the special case of a command error that occurred after command response frames were emitted. The code for error handling still needs a ton of work. But we're slowly going in the right direction... Differential Revision: https://phab.mercurial-scm.org/D3386
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 14 Apr 2018 15:36:12 -0700
parents 3ea8323d6f95
children b099e6032f38
line wrap: on
line diff
--- a/tests/test-wireproto-serverreactor.py	Sat Apr 14 15:19:36 2018 -0700
+++ b/tests/test-wireproto-serverreactor.py	Sat Apr 14 15:36:12 2018 -0700
@@ -373,16 +373,18 @@
             b'1 2 0 command-response eos %s' % second,
         ])
 
-    def testapplicationerror(self):
+    def testservererror(self):
         reactor = makereactor()
         instream = framing.stream(1)
         list(sendcommandframes(reactor, instream, 1, b'mycommand', {}))
 
         outstream = reactor.makeoutputstream()
-        result = reactor.onapplicationerror(outstream, 1, b'some message')
+        result = reactor.onservererror(outstream, 1, b'some message')
         self.assertaction(result, b'sendframes')
         self.assertframesequal(result[1][b'framegen'], [
-            b'1 2 stream-begin error-response application some message',
+            b"1 2 stream-begin error-response 0 "
+            b"cbor:{b'type': b'server', "
+            b"b'message': [{b'msg': b'some message'}]}",
         ])
 
     def test1commanddeferresponse(self):