~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/bzrdir_implementations/test_bzrdir.py

Branch now uses BzrDir reasonably sanely.

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
                          self.bzrdir_format.open,
128
128
                          get_transport(self.get_readonly_url()))
129
129
 
 
130
    def test_create_branch(self):
 
131
        # a bzrdir can construct a repository for itself.
 
132
        if not self.bzrdir_format.is_supported():
 
133
            # unsupported formats are not loopback testable
 
134
            # because the default open will not open them and
 
135
            # they may not be initializable.
 
136
            return
 
137
        t = get_transport(self.get_url())
 
138
        made_control = self.bzrdir_format.initialize(t.base)
 
139
        made_repo = made_control.create_repository()
 
140
        made_branch = made_control.create_branch()
 
141
        self.failUnless(isinstance(made_branch, branch.Branch))
 
142
        self.assertEqual(made_control, made_branch.bzrdir)
 
143
        
 
144
    def test_open_branch(self):
 
145
        if not self.bzrdir_format.is_supported():
 
146
            # unsupported formats are not loopback testable
 
147
            # because the default open will not open them and
 
148
            # they may not be initializable.
 
149
            return
 
150
        t = get_transport(self.get_url())
 
151
        made_control = self.bzrdir_format.initialize(t.base)
 
152
        made_repo = made_control.create_repository()
 
153
        made_branch = made_control.create_branch()
 
154
        opened_branch = made_control.open_branch()
 
155
        self.assertEqual(made_control, opened_branch.bzrdir)
 
156
        self.failUnless(isinstance(opened_branch, made_branch.__class__))
 
157
 
130
158
    def test_create_repository(self):
131
159
        # a bzrdir can construct a repository for itself.
132
160
        if not self.bzrdir_format.is_supported():