Mercurial > hg
comparison tests/test-cbor.py @ 37899:2b3b6187c316
tests: port test-cbor.py to Python 3
I suspect this b''.join() was a remnant of an earlier iteration of
this code, as it was building a string from a string.
Differential Revision: https://phab.mercurial-scm.org/D3505
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 27 Apr 2018 11:07:24 -0400 |
parents | 65a23cc8e75b |
children | aeb551a3bb8a |
comparison
equal
deleted
inserted
replaced
37898:2ae6a3134362 | 37899:2b3b6187c316 |
---|---|
67 self.assertEqual(next(it), b'\x42') | 67 self.assertEqual(next(it), b'\x42') |
68 self.assertEqual(next(it), b'\xff\xff') | 68 self.assertEqual(next(it), b'\xff\xff') |
69 | 69 |
70 dest = b''.join(cborutil.streamencodeindefinitebytestring( | 70 dest = b''.join(cborutil.streamencodeindefinitebytestring( |
71 source, chunksize=42)) | 71 source, chunksize=42)) |
72 self.assertEqual(cbor.loads(dest), b''.join(source)) | 72 self.assertEqual(cbor.loads(dest), source) |
73 | 73 |
74 def testreadtoiter(self): | 74 def testreadtoiter(self): |
75 source = io.BytesIO(b'\x5f\x44\xaa\xbb\xcc\xdd\x43\xee\xff\x99\xff') | 75 source = io.BytesIO(b'\x5f\x44\xaa\xbb\xcc\xdd\x43\xee\xff\x99\xff') |
76 | 76 |
77 it = cborutil.readindefinitebytestringtoiter(source) | 77 it = cborutil.readindefinitebytestringtoiter(source) |