Rev 3137: Re-add a test lost in refactoring. in file:///v/home/vila/src/bzr/bugs/175524/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Mon Dec 24 15:40:12 GMT 2007
At file:///v/home/vila/src/bzr/bugs/175524/
------------------------------------------------------------
revno: 3137
revision-id:v.ladeuil+lp at free.fr-20071224154008-3epy24f8ysx9k4dp
parent: v.ladeuil+lp at free.fr-20071224152910-mcym6zmmzt9x2es2
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 175524
timestamp: Mon 2007-12-24 16:40:08 +0100
message:
Re-add a test lost in refactoring.
* bzrlib/tests/test_http.py:
(TestAuth.test_changing_nonce): This one was lost during one
refactoring.
modified:
bzrlib/tests/test_http.py testhttp.py-20051018020158-b2eef6e867c514d9
-------------- next part --------------
=== modified file 'bzrlib/tests/test_http.py'
--- a/bzrlib/tests/test_http.py 2007-12-24 15:29:10 +0000
+++ b/bzrlib/tests/test_http.py 2007-12-24 15:40:08 +0000
@@ -1366,6 +1366,26 @@
# Only one 'Authentication Required' error should occur
self.assertEqual(1, self.server.auth_required_errors)
+ def test_changing_nonce(self):
+ if self._auth_scheme != 'digest':
+ raise tests.TestNotApplicable('HTTP auth digest only test')
+ if self._testing_pycurl():
+ raise tests.KnownFailure(
+ 'pycurl does not handle a nonce change')
+ self.server.add_user('joe', 'foo')
+ t = self.get_user_transport('joe', 'foo')
+ self.assertEqual('contents of a\n', t.get('a').read())
+ self.assertEqual('contents of b\n', t.get('b').read())
+ # Only one 'Authentication Required' error should have
+ # occured so far
+ self.assertEqual(1, self.server.auth_required_errors)
+ # The server invalidates the current nonce
+ self.server.auth_nonce = self.server.auth_nonce + '. No, now!'
+ self.assertEqual('contents of a\n', t.get('a').read())
+ # Two 'Authentication Required' errors should occur (the
+ # initial 'who are you' and a second 'who are you' with the new nonce)
+ self.assertEqual(2, self.server.auth_required_errors)
+
class TestProxyAuth(TestAuth):
More information about the bazaar-commits
mailing list