~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(robertc) Partial fix for bug #39542 - allow lightweight checkouts over http.

Show diffs side-by-side

added added

removed removed

Lines of Context:
405
405
        os.mkdir('e')
406
406
        checkout_e = branch_a.create_checkout('e')
407
407
 
 
408
    def test_create_anonymous_lightweight_checkout(self):
 
409
        """A checkout from a readonly branch should succeed."""
 
410
        tree_a = self.make_branch_and_tree('a')
 
411
        rev_id = tree_a.commit('put some content in the branch')
 
412
        source_branch = bzrlib.branch.Branch.open(
 
413
            'readonly+' + tree_a.bzrdir.root_transport.base)
 
414
        # sanity check that the test will be valid
 
415
        self.assertRaises((errors.LockError, errors.TransportNotPossible),
 
416
            source_branch.lock_write)
 
417
        checkout = source_branch.create_checkout('c', lightweight=True)
 
418
        self.assertEqual(rev_id, checkout.last_revision())
 
419
 
408
420
 
409
421
class ChrootedTests(TestCaseWithBranch):
410
422
    """A support class that provides readonly urls outside the local namespace.