~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch.py

  • Committer: John Arbash Meinel
  • Date: 2009-02-23 15:29:35 UTC
  • mfrom: (3943.7.7 bzr.code_style_cleanup)
  • mto: This revision was merged to the branch mainline in revision 4033.
  • Revision ID: john@arbash-meinel.com-20090223152935-oel9m92mwcc6nb4h
Merge the removal of all trailing whitespace, and resolve conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
    PullResult,
44
44
    _run_with_write_locked_target,
45
45
    )
46
 
from bzrlib.bzrdir import (BzrDirMetaFormat1, BzrDirMeta1, 
 
46
from bzrlib.bzrdir import (BzrDirMetaFormat1, BzrDirMeta1,
47
47
                           BzrDir, BzrDirFormat)
48
48
from bzrlib.errors import (NotBranchError,
49
49
                           UnknownFormatError,
64
64
 
65
65
    def test_default_format_is_same_as_bzrdir_default(self):
66
66
        # XXX: it might be nice if there was only one place the default was
67
 
        # set, but at the moment that's not true -- mbp 20070814 -- 
 
67
        # set, but at the moment that's not true -- mbp 20070814 --
68
68
        # https://bugs.launchpad.net/bzr/+bug/132376
69
69
        self.assertEqual(BranchFormat.get_default_format(),
70
70
                BzrDirFormat.get_default_format().get_branch_format())
134
134
class SampleBranchFormat(BranchFormat):
135
135
    """A sample format
136
136
 
137
 
    this format is initializable, unsupported to aid in testing the 
 
137
    this format is initializable, unsupported to aid in testing the
138
138
    open and open_downlevel routines.
139
139
    """
140
140
 
161
161
    def test_find_format(self):
162
162
        # is the right format object found for a branch?
163
163
        # create a branch with a few known format objects.
164
 
        # this is not quite the same as 
 
164
        # this is not quite the same as
165
165
        self.build_tree(["foo/", "bar/"])
166
166
        def check_format(format, url):
167
167
            dir = format._matchingbzrdir.initialize(url)
170
170
            found_format = BranchFormat.find_format(dir)
171
171
            self.failUnless(isinstance(found_format, format.__class__))
172
172
        check_format(BzrBranchFormat5(), "bar")
173
 
        
 
173
 
174
174
    def test_find_format_not_branch(self):
175
175
        dir = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
176
176
        self.assertRaises(NotBranchError,
451
451
 
452
452
    def lock_write(self):
453
453
        self.calls.append('lock_write')
454
 
    
 
454
 
455
455
    def unlock(self):
456
456
        self.calls.append('unlock')
457
457
        if self.unlock_exc is not None: