~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-07-22 18:09:04 UTC
  • mfrom: (2485.8.63 bzr.connection.sharing)
  • Revision ID: pqm@pqm.ubuntu.com-20070722180904-wy7y7oyi32wbghgf
Transport connection sharing

Show diffs side-by-side

added added

removed removed

Lines of Context:
198
198
        """See BzrDirFormat.get_format_string()."""
199
199
        return "Sample .bzr dir format."
200
200
 
201
 
    def initialize(self, url):
 
201
    def initialize(self, url, possible_transports=None):
202
202
        """Create a bzr dir."""
203
 
        t = get_transport(url)
 
203
        t = get_transport(url, possible_transports)
204
204
        t.mkdir('.bzr')
205
205
        t.put_bytes('.bzr/branch-format', self.get_format_string())
206
206
        return SampleBzrDir(t, self)
288
288
 
289
289
    def test_create_branch_and_repo_uses_default(self):
290
290
        format = SampleBzrDirFormat()
291
 
        branch = bzrdir.BzrDir.create_branch_and_repo(self.get_url(), 
 
291
        branch = bzrdir.BzrDir.create_branch_and_repo(self.get_url(),
292
292
                                                      format=format)
293
293
        self.assertTrue(isinstance(branch, SampleBranch))
294
294
 
343
343
        branch.bzrdir.open_workingtree()
344
344
        branch.bzrdir.open_repository()
345
345
 
 
346
    def test_create_branch_convenience_possible_transports(self):
 
347
        """Check that the optional 'possible_transports' is recognized"""
 
348
        format = bzrdir.format_registry.make_bzrdir('knit')
 
349
        t = self.get_transport()
 
350
        branch = bzrdir.BzrDir.create_branch_convenience(
 
351
            '.', format=format, possible_transports=[t])
 
352
        branch.bzrdir.open_workingtree()
 
353
        branch.bzrdir.open_repository()
 
354
 
346
355
    def test_create_branch_convenience_root(self):
347
356
        """Creating a branch at the root of a fs should work."""
348
357
        self.vfs_transport_factory = MemoryServer