~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch_implementations.py

Tweak formats implementation test to exercise readonly and readwrite transports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
 
53
53
    def get_branch(self):
54
54
        if self.branch is None:
55
 
            self.branch = self.make_branch('.')
 
55
            self.branch = self.make_branch(self.get_url())
56
56
        return self.branch
57
57
 
58
58
    def make_branch(self, relpath):
445
445
            # they may not be initializable.
446
446
            return
447
447
        # supported formats must be able to init and open
448
 
        t = get_transport('.')
 
448
        t = get_transport(self.get_url())
 
449
        readonly_t = get_transport(self.get_readonly_url())
449
450
        made_branch = self.branch_format.initialize(t.base)
450
451
        self.failUnless(isinstance(made_branch, branch.Branch))
451
452
        self.assertEqual(self.branch_format,
452
 
                         branch.BzrBranchFormat.find_format(t))
453
 
        direct_opened_branch = self.branch_format.open(t)
 
453
                         branch.BzrBranchFormat.find_format(readonly_t))
 
454
        direct_opened_branch = self.branch_format.open(readonly_t)
454
455
        opened_branch = branch.Branch.open(t.base)
455
456
        self.assertEqual(made_branch._branch_format,
456
457
                         opened_branch._branch_format)
461
462
    def test_open_not_branch(self):
462
463
        self.assertRaises(NoSuchFile,
463
464
                          self.branch_format.open,
464
 
                          get_transport('.'))
 
465
                          get_transport(self.get_readonly_url()))