/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch_implementations.py

Turn branch format.open into a factory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from bzrlib.commit import commit
26
26
import bzrlib.errors as errors
27
27
from bzrlib.errors import (NoSuchRevision,
 
28
                           NoSuchFile,
28
29
                           UninitializableFormat,
29
 
                           UnlistableBranch,
30
30
                           NotBranchError,
31
31
                           )
32
32
import bzrlib.gpg
428
428
    def test_format_initialize_find_open(self):
429
429
        # loopback test to check the current format initializes to itself.
430
430
        made_branch = self.make_branch('.')
 
431
        self.failUnless(isinstance(made_branch, branch.Branch))
431
432
        t = get_transport('.')
432
433
        self.assertEqual(self.branch_format,
433
434
                         branch.BzrBranchFormat.find_format(t))
434
 
        opened_branch = branch.Branch.open('.')
 
435
        opened_branch = self.branch_format.open(t)
435
436
        self.assertEqual(made_branch._branch_format, opened_branch._branch_format)
 
437
        self.failUnless(isinstance(opened_branch, branch.Branch))
 
438
 
 
439
    def test_open_not_branch(self):
 
440
        self.assertRaises(NoSuchFile,
 
441
                          self.branch_format.open,
 
442
                          get_transport('.'))