##// END OF EJS Templates
tests: port inline extensions in test-http.t to Python 3...
Augie Fackler -
r37751:d43810fe default
parent child Browse files
Show More
@@ -61,7 +61,7 b' try to clone via stream but missing requ'
61 61 $ cat > $TESTTMP/removesupportedformat.py << EOF
62 62 > from mercurial import localrepo
63 63 > def extsetup(ui):
64 > localrepo.localrepository.supportedformats.remove('generaldelta')
64 > localrepo.localrepository.supportedformats.remove(b'generaldelta')
65 65 > EOF
66 66
67 67 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3
@@ -170,12 +170,12 b' test http authentication'
170 170 > import base64
171 171 > from mercurial.hgweb import common
172 172 > def perform_authentication(hgweb, req, op):
173 > auth = req.headers.get('Authorization')
173 > auth = req.headers.get(b'Authorization')
174 174 > if not auth:
175 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who',
176 > [('WWW-Authenticate', 'Basic Realm="mercurial"')])
177 > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
178 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no')
175 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who',
176 > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')])
177 > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', b'pass']:
178 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no')
179 179 > def extsetup():
180 180 > common.permhooks.insert(0, perform_authentication)
181 181 > EOT
@@ -514,10 +514,10 b' We raise HTTP 500 because its message is'
514 514 > from mercurial import util
515 515 > from mercurial.hgweb import common
516 516 > def perform_authentication(hgweb, req, op):
517 > cookie = req.headers.get('Cookie')
517 > cookie = req.headers.get(b'Cookie')
518 518 > if not cookie:
519 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'no-cookie')
520 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, 'Cookie: %s' % cookie)
519 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'no-cookie')
520 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'Cookie: %s' % cookie)
521 521 > def extsetup():
522 522 > common.permhooks.insert(0, perform_authentication)
523 523 > EOF
General Comments 0
You need to be logged in to leave comments. Login now