~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_split.py

  • Committer: Vincent Ladeuil
  • Date: 2009-05-04 14:48:21 UTC
  • mto: (4349.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4350.
  • Revision ID: v.ladeuil+lp@free.fr-20090504144821-39dvqkikmd3zqkdg
Handle servers proposing several authentication schemes.

* bzrlib/transport/http/_urllib2_wrappers.py:
(AbstractAuthHandler.auth_required): Several schemes can be
proposed by the server, try to match each one in turn.
(BasicAuthHandler.auth_match): Delete dead code.

* bzrlib/tests/test_http.py:
(load_tests): Separate proxy and http authentication tests as they
require different server setups.
(TestAuth.create_transport_readonly_server): Simplified by using
parameter provided by load_tests.
(TestAuth.test_changing_nonce): Adapt to new parametrization.
(TestProxyAuth.create_transport_readonly_server): Deleted.

* bzrlib/tests/http_utils.py:
(DigestAndBasicAuthRequestHandler, HTTPBasicAndDigestAuthServer,
ProxyBasicAndDigestAuthServer): Add a test server proposing both
basic and digest auth schemes but accepting only digest as valid.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
 
from bzrlib import tests, workingtree
 
18
import os
 
19
 
 
20
from bzrlib import bzrdir, tests, workingtree
19
21
from bzrlib.repofmt.knitrepo import RepositoryFormatKnit4
20
 
from bzrlib.repofmt.knitpack_repo import RepositoryFormatKnitPack4
 
22
from bzrlib.repofmt.pack_repo import RepositoryFormatKnitPack4
21
23
 
22
24
 
23
25
 
29
31
        wt.add(['b', 'b/c'])
30
32
        wt.commit('rev1')
31
33
        self.run_bzr('split a/b')
32
 
        self.run_bzr_error(('.* is not versioned',), 'split q', working_dir='a')
 
34
        self.run_bzr_error(('.* is not versioned',), 'split q')
33
35
 
34
36
    def test_split_repo_failure(self):
35
37
        repo = self.make_repository('branch', shared=True, format='knit')
45
47
        self.build_tree(['tree/subtree/'])
46
48
        tree.add('subtree')
47
49
        tree.commit('added subtree')
48
 
        self.run_bzr_error(('must upgrade your branch at .*tree','rich roots'),
 
50
        self.run_bzr_error(('must upgrade your branch at .*tree',),
49
51
                           'split tree/subtree')
50
52
 
51
53
    def split_formats(self, format, repo_format):