# HG changeset patch # User Augie Fackler # Date 1546904270 18000 # Node ID a181a1c8af1d5f05dbeed97bde579f6e69a90c8e # Parent 050ea8eb42a5fa7394307bc3ca5ae02b098750c0 tests: migrate test-wireproto-serverreactor.py to our internal CBOR This leaves the only client of thirdparty.cbor as test-cbor.py, which appears to be testing the behavior of cborutil against cbor. We should figure out some appropriate test strings and drop thirdparty.cbor, but that's a mission for another day. Differential Revision: https://phab.mercurial-scm.org/D5522 diff -r 050ea8eb42a5 -r a181a1c8af1d tests/test-wireproto-serverreactor.py --- a/tests/test-wireproto-serverreactor.py Mon Jan 07 16:34:04 2019 -0500 +++ b/tests/test-wireproto-serverreactor.py Mon Jan 07 18:37:50 2019 -0500 @@ -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]),