py3: byteify an inline python test extension
authorMatt Harbison <matt_harbison@yahoo.com>
Tue, 25 Sep 2018 22:11:17 -0400
changeset 39840 91d63fd58e7d
parent 39839 d1e0b905c59d
child 39841 f1d6021453c2
py3: byteify an inline python test extension # skip-blame for b'' prefixing
tests/test-largefiles-wireproto.t
--- a/tests/test-largefiles-wireproto.t	Tue Sep 25 21:39:42 2018 -0400
+++ b/tests/test-largefiles-wireproto.t	Tue Sep 25 22:11:17 2018 -0400
@@ -424,12 +424,12 @@
   > import base64
   > from mercurial.hgweb import common
   > def perform_authentication(hgweb, req, op):
-  >     auth = req.headers.get('Authorization')
+  >     auth = req.headers.get(b'Authorization')
   >     if not auth:
-  >         raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who',
-  >                 [('WWW-Authenticate', 'Basic Realm="mercurial"')])
-  >     if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
-  >         raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no')
+  >         raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who',
+  >                 [(b'WWW-Authenticate', b'Basic Realm="mercurial"')])
+  >     if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', b'pass']:
+  >         raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no')
   > def extsetup():
   >     common.permhooks.insert(0, perform_authentication)
   > EOT