tests: port inline extension in test-http-bundle1.t to py3
authorAugie Fackler <augie@google.com>
Sat, 14 Apr 2018 00:56:53 -0400
changeset 37683 e481d54f516d
parent 37682 cb71e0f9ac6f
child 37684 5fc502e149f1
tests: port inline extension in test-http-bundle1.t to py3 # skip-blame just b prefixes Differential Revision: https://phab.mercurial-scm.org/D3366
tests/test-http-bundle1.t
--- a/tests/test-http-bundle1.t	Sat Apr 14 01:35:44 2018 -0400
+++ b/tests/test-http-bundle1.t	Sat Apr 14 00:56:53 2018 -0400
@@ -179,13 +179,13 @@
   > 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"')])
+  >         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, 'no')
+  >         raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no')
   > def extsetup():
   >     common.permhooks.insert(0, perform_authentication)
   > EOT