changeset 40871:1aedbf3ef3d1

py3: adapt test-largefiles-wireproto.t to python3
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 09 Dec 2018 18:35:35 -0500
parents d3d52cc91e83
children 07e181ed82ef
files contrib/python3-whitelist tests/test-largefiles-wireproto.t
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/python3-whitelist	Sun Dec 09 13:53:08 2018 -0500
+++ b/contrib/python3-whitelist	Sun Dec 09 18:35:35 2018 -0500
@@ -305,6 +305,7 @@
 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
--- a/tests/test-largefiles-wireproto.t	Sun Dec 09 13:53:08 2018 -0500
+++ b/tests/test-largefiles-wireproto.t	Sun Dec 09 18:35:35 2018 -0500
@@ -240,10 +240,10 @@
 
 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)