~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Robert Collins
  • Date: 2007-07-25 00:52:21 UTC
  • mfrom: (2650 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2651.
  • Revision ID: robertc@robertcollins.net-20070725005221-0ysm6il5mqnme3wz
Merge bzr.dev.

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