~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Split out repository into .bzr/repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
240
240
        # and the dir which has been initialized for us must be statable.
241
241
        found_transport.stat('.')
242
242
 
 
243
    def test_get_repository_transport(self):
 
244
        dir = self.make_bzrdir('.')
 
245
        # without a format, get_repository_transport gives use a transport
 
246
        # which -may- point to an existing dir.
 
247
        self.assertTrue(isinstance(dir.get_repository_transport(None),
 
248
                                   transport.Transport))
 
249
        # with a given format, either the bzr dir supports identifiable
 
250
        # repositoryes, or it supports anonymous  repository formats, but not both.
 
251
        anonymous_format = repository.RepositoryFormat6()
 
252
        identifiable_format = repository.RepositoryFormat7()
 
253
        try:
 
254
            found_transport = dir.get_repository_transport(anonymous_format)
 
255
            self.assertRaises(errors.IncompatibleFormat,
 
256
                              dir.get_repository_transport,
 
257
                              identifiable_format)
 
258
        except errors.IncompatibleFormat:
 
259
            found_transport = dir.get_repository_transport(identifiable_format)
 
260
        self.assertTrue(isinstance(found_transport, transport.Transport))
 
261
        # and the dir which has been initialized for us must be statable.
 
262
        found_transport.stat('.')
 
263
 
243
264
    def test_get_workingtree_transport(self):
244
265
        dir = self.make_bzrdir('.')
245
266
        # without a format, get_workingtree_transport gives use a transport