D3342: tests: port inline extensions in test-http.t to Python 3

2018-04-16 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd43810fe52b0: tests: port inline extensions in test-http.t 
to Python 3 (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3342?vs=8219&id=8336

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

AFFECTED FILES
  tests/test-http.t

CHANGE DETAILS

diff --git a/tests/test-http.t b/tests/test-http.t
--- a/tests/test-http.t
+++ b/tests/test-http.t
@@ -61,7 +61,7 @@
   $ cat > $TESTTMP/removesupportedformat.py << EOF
   > from mercurial import localrepo
   > def extsetup(ui):
-  > localrepo.localrepository.supportedformats.remove('generaldelta')
+  > localrepo.localrepository.supportedformats.remove(b'generaldelta')
   > EOF
 
   $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py 
--stream http://localhost:$HGPORT/ copy3
@@ -170,12 +170,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
@@ -514,10 +514,10 @@
   > from mercurial import util
   > from mercurial.hgweb import common
   > def perform_authentication(hgweb, req, op):
-  > cookie = req.headers.get('Cookie')
+  > cookie = req.headers.get(b'Cookie')
   > if not cookie:
-  > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'no-cookie')
-  > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'Cookie: %s' % 
cookie)
+  > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'no-cookie')
+  > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'Cookie: %s' % 
cookie)
   > def extsetup():
   > common.permhooks.insert(0, perform_authentication)
   > EOF



To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3342: tests: port inline extensions in test-http.t to Python 3

2018-04-13 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-http.t

CHANGE DETAILS

diff --git a/tests/test-http.t b/tests/test-http.t
--- a/tests/test-http.t
+++ b/tests/test-http.t
@@ -61,7 +61,7 @@
   $ cat > $TESTTMP/removesupportedformat.py << EOF
   > from mercurial import localrepo
   > def extsetup(ui):
-  > localrepo.localrepository.supportedformats.remove('generaldelta')
+  > localrepo.localrepository.supportedformats.remove(b'generaldelta')
   > EOF
 
   $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py 
--stream http://localhost:$HGPORT/ copy3
@@ -170,12 +170,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
@@ -514,10 +514,10 @@
   > from mercurial import util
   > from mercurial.hgweb import common
   > def perform_authentication(hgweb, req, op):
-  > cookie = req.headers.get('Cookie')
+  > cookie = req.headers.get(b'Cookie')
   > if not cookie:
-  > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'no-cookie')
-  > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'Cookie: %s' % 
cookie)
+  > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'no-cookie')
+  > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'Cookie: %s' % 
cookie)
   > def extsetup():
   > common.permhooks.insert(0, perform_authentication)
   > EOF



To: durin42, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel