~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

Bring in both branch-builder threads.

Show diffs side-by-side

added added

removed removed

Lines of Context:
556
556
        self.failIf(osutils.lexists('dir'))
557
557
 
558
558
    def test_make_branch_builder_with_format(self):
 
559
        # Use a repo layout that doesn't conform to a 'named' layout, to ensure
 
560
        # that the format objects are used.
559
561
        format = bzrdir.BzrDirMetaFormat1()
560
 
        format.repository_format = weaverepo.RepositoryFormat7()
 
562
        repo_format = weaverepo.RepositoryFormat7()
 
563
        format.repository_format = repo_format
561
564
        builder = self.make_branch_builder('dir', format=format)
562
565
        the_branch = builder.get_branch()
563
566
        # Guard against regression into MemoryTransport leaking
565
568
        self.failIf(osutils.lexists('dir'))
566
569
        self.assertEqual(format.repository_format.__class__,
567
570
                         the_branch.repository._format.__class__)
 
571
        self.assertEqual(repo_format.get_format_string(),
 
572
                         self.get_transport().get_bytes(
 
573
                            'dir/.bzr/repository/format'))
568
574
 
569
575
    def test_make_branch_builder_with_format_name(self):
570
576
        builder = self.make_branch_builder('dir', format='knit')
575
581
        dir_format = bzrdir.format_registry.make_bzrdir('knit')
576
582
        self.assertEqual(dir_format.repository_format.__class__,
577
583
                         the_branch.repository._format.__class__)
 
584
        self.assertEqual('Bazaar-NG Knit Repository Format 1',
 
585
                         self.get_transport().get_bytes(
 
586
                            'dir/.bzr/repository/format'))
578
587
 
579
588
    def test_safety_net(self):
580
589
        """No test should modify the safety .bzr directory.