py3: adapt test-largefiles-wireproto.t to python3
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 09 Dec 2018 18:35:35 -0500
changeset 53636 1aedbf3ef3d128eae75381775cfdc52e033d6ff3
parent 53635 d3d52cc91e83c3f9200ecacb09ee4a64e04b12b5
child 53637 07e181ed82efe7e4c61ea9dc0a58168cc81ba1c1
push id1079
push usergszorc@mozilla.com
push dateMon, 10 Dec 2018 19:44:59 +0000
py3: adapt test-largefiles-wireproto.t to python3
contrib/python3-whitelist
tests/test-largefiles-wireproto.t
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -300,16 +300,17 @@ test-journal-exists.t
 test-journal-share.t
 test-journal.t
 test-keyword.t
 test-known.t
 test-largefiles-cache.t
 test-largefiles-misc.t
 test-largefiles-small-disk.t
 test-largefiles-update.t
+test-largefiles-wireproto.t
 test-largefiles.t
 test-lfconvert.t
 test-lfs-bundle.t
 test-lfs-largefiles.t
 test-lfs-pointer.py
 test-lfs.t
 test-linelog.py
 test-linerange.py
--- a/tests/test-largefiles-wireproto.t
+++ b/tests/test-largefiles-wireproto.t
@@ -235,20 +235,20 @@ Clone over http, no largefiles pulled on
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
   new changesets cf03e5bb9936 (1 drafts)
 
 Archive contains largefiles
   >>> import os
-  >>> import urllib2
+  >>> from mercurial import urllibcompat
   >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2']
-  >>> with open('archive.zip', 'w') as f:
-  ...     f.write(urllib2.urlopen(u).read()) and None
+  >>> with open('archive.zip', 'wb') as f:
+  ...     f.write(urllibcompat.urlreq.urlopen(u).read()) and None
   $ unzip -t archive.zip
   Archive:  archive.zip
       testing: empty-default/.hg_archival.txt*OK (glob)
       testing: empty-default/f1*OK (glob)
   No errors detected in compressed data of archive.zip.
 
 test 'verify' with remotestore: