240
240
# and the dir which has been initialized for us must be statable.
241
241
found_transport.stat('.')
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()
254
found_transport = dir.get_repository_transport(anonymous_format)
255
self.assertRaises(errors.IncompatibleFormat,
256
dir.get_repository_transport,
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('.')
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