Patchwork D5522: tests: migrate test-wireproto-serverreactor.py to our internal CBOR

login
register
mail settings
Submitter phabricator
Date Jan. 8, 2019, 12:39 p.m.
Message ID <0c29b800b03d95c676a79ff9abf051fd@localhost.localdomain>
Download mbox | patch
Permalink /patch/37555/
State Not Applicable
Headers show

Comments

phabricator - Jan. 8, 2019, 12:39 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa181a1c8af1d: tests: migrate test-wireproto-serverreactor.py to our internal CBOR (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5522?vs=13069&id=13074

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

AFFECTED FILES
  tests/test-wireproto-serverreactor.py

CHANGE DETAILS




To: durin42, indygreg, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/tests/test-wireproto-serverreactor.py b/tests/test-wireproto-serverreactor.py
--- a/tests/test-wireproto-serverreactor.py
+++ b/tests/test-wireproto-serverreactor.py
@@ -2,9 +2,6 @@ 
 
 import unittest
 
-from mercurial.thirdparty import (
-    cbor,
-)
 from mercurial import (
     ui as uimod,
     util,
@@ -16,7 +13,7 @@ 
 
 ffs = framing.makeframefromhumanstring
 
-OK = cbor.dumps({b'status': b'ok'})
+OK = b''.join(cborutil.streamencode({b'status': b'ok'}))
 
 def makereactor(deferoutput=False):
     ui = uimod.ui()
@@ -270,20 +267,20 @@ 
         })
 
     def testinterleavedcommands(self):
-        cbor1 = cbor.dumps({
+        cbor1 = b''.join(cborutil.streamencode({
             b'name': b'command1',
             b'args': {
                 b'foo': b'bar',
                 b'key1': b'val',
             }
-        }, canonical=True)
-        cbor3 = cbor.dumps({
+        }))
+        cbor3 = b''.join(cborutil.streamencode({
             b'name': b'command3',
             b'args': {
                 b'biz': b'baz',
                 b'key': b'val',
             },
-        }, canonical=True)
+        }))
 
         results = list(sendframes(makereactor(), [
             ffs(b'1 1 stream-begin command-request new|more %s' % cbor1[0:6]),