~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_branch.py

(jelmer) Add ControlDirFormat.supports_transport(). (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
446
446
        tree_a = self.make_branch_and_tree('a')
447
447
        rev_id = tree_a.commit('put some content in the branch')
448
448
        # open the branch via a readonly transport
449
 
        source_branch = _mod_branch.Branch.open(self.get_readonly_url('a'))
 
449
        url = self.get_readonly_url('a')
 
450
        t = transport.get_transport_from_url(url)
 
451
        if not tree_a.branch.bzrdir._format.supports_transport(t):
 
452
            raise tests.TestNotApplicable("format does not support transport")
 
453
        source_branch = _mod_branch.Branch.open(url)
450
454
        # sanity check that the test will be valid
451
455
        self.assertRaises((errors.LockError, errors.TransportNotPossible),
452
456
            source_branch.lock_write)
534
538
                          _mod_branch.Branch.open_containing,
535
539
                          self.get_readonly_url('g/p/q'))
536
540
        branch = self.make_branch('.')
 
541
        if not branch.bzrdir._format.supports_transport(
 
542
            transport.get_transport_from_url(self.get_readonly_url('.'))):
 
543
            raise tests.TestNotApplicable("format does not support transport")
537
544
        branch, relpath = _mod_branch.Branch.open_containing(
538
545
            self.get_readonly_url(''))
539
546
        self.assertEqual('', relpath)