~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http.py

  • Committer: Vincent Ladeuil
  • Date: 2007-12-24 15:40:08 UTC
  • mto: (3146.3.1 179368) (3156.2.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 3158.
  • Revision ID: v.ladeuil+lp@free.fr-20071224154008-3epy24f8ysx9k4dp
Re-add a test lost in refactoring.

* bzrlib/tests/test_http.py:
(TestAuth.test_changing_nonce): This one was lost during one
refactoring.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1366
1366
        # Only one 'Authentication Required' error should occur
1367
1367
        self.assertEqual(1, self.server.auth_required_errors)
1368
1368
 
 
1369
    def test_changing_nonce(self):
 
1370
        if self._auth_scheme != 'digest':
 
1371
            raise tests.TestNotApplicable('HTTP auth digest only test')
 
1372
        if self._testing_pycurl():
 
1373
            raise tests.KnownFailure(
 
1374
                'pycurl does not handle a nonce change')
 
1375
        self.server.add_user('joe', 'foo')
 
1376
        t = self.get_user_transport('joe', 'foo')
 
1377
        self.assertEqual('contents of a\n', t.get('a').read())
 
1378
        self.assertEqual('contents of b\n', t.get('b').read())
 
1379
        # Only one 'Authentication Required' error should have
 
1380
        # occured so far
 
1381
        self.assertEqual(1, self.server.auth_required_errors)
 
1382
        # The server invalidates the current nonce
 
1383
        self.server.auth_nonce = self.server.auth_nonce + '. No, now!'
 
1384
        self.assertEqual('contents of a\n', t.get('a').read())
 
1385
        # Two 'Authentication Required' errors should occur (the
 
1386
        # initial 'who are you' and a second 'who are you' with the new nonce)
 
1387
        self.assertEqual(2, self.server.auth_required_errors)
 
1388
 
1369
1389
 
1370
1390
 
1371
1391
class TestProxyAuth(TestAuth):