Patchwork D3505: tests: port test-cbor.py to Python 3

login
register
mail settings
Submitter phabricator
Date May 8, 2018, 7:27 p.m.
Message ID <differential-rev-PHID-DREV-mgrtmsstueu4isld7qvp-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/31405/
State Superseded
Headers show

Comments

phabricator - May 8, 2018, 7:27 p.m.
durin42 created this revision.
Herald added a reviewer: pulkit.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I suspect this b''.join() was a remnant of an earlier iteration of
  this code, as it was building a string from a string.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/python3-whitelist
  tests/test-cbor.py

CHANGE DETAILS




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

Patch

diff --git a/tests/test-cbor.py b/tests/test-cbor.py
--- a/tests/test-cbor.py
+++ b/tests/test-cbor.py
@@ -69,7 +69,7 @@ 
 
         dest = b''.join(cborutil.streamencodeindefinitebytestring(
             source, chunksize=42))
-        self.assertEqual(cbor.loads(dest), b''.join(source))
+        self.assertEqual(cbor.loads(dest), source)
 
     def testreadtoiter(self):
         source = io.BytesIO(b'\x5f\x44\xaa\xbb\xcc\xdd\x43\xee\xff\x99\xff')
diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -36,6 +36,7 @@ 
 test-cappedreader.py
 test-casecollision.t
 test-cat.t
+test-cbor.py
 test-censor.t
 test-changelog-exec.t
 test-check-commit.t