~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
    )
56
56
from bzrlib.repofmt import (
57
57
    groupcompress_repo,
58
 
    weaverepo,
59
58
    )
60
59
from bzrlib.symbol_versioning import (
61
60
    deprecated_function,
339
338
        from bzrlib.tests.per_workingtree import make_scenarios
340
339
        server1 = "a"
341
340
        server2 = "b"
342
 
        formats = [workingtree.WorkingTreeFormat2(),
 
341
        formats = [workingtree.WorkingTreeFormat4(),
343
342
                   workingtree.WorkingTreeFormat3(),]
344
343
        scenarios = make_scenarios(server1, server2, formats)
345
344
        self.assertEqual([
346
 
            ('WorkingTreeFormat2',
 
345
            ('WorkingTreeFormat4',
347
346
             {'bzrdir_format': formats[0]._matchingbzrdir,
348
347
              'transport_readonly_server': 'b',
349
348
              'transport_server': 'a',
376
375
            )
377
376
        server1 = "a"
378
377
        server2 = "b"
379
 
        formats = [workingtree.WorkingTreeFormat2(),
 
378
        formats = [workingtree.WorkingTreeFormat4(),
380
379
                   workingtree.WorkingTreeFormat3(),]
381
380
        scenarios = make_scenarios(server1, server2, formats)
382
381
        self.assertEqual(7, len(scenarios))
384
383
        wt4_format = workingtree.WorkingTreeFormat4()
385
384
        wt5_format = workingtree.WorkingTreeFormat5()
386
385
        expected_scenarios = [
387
 
            ('WorkingTreeFormat2',
 
386
            ('WorkingTreeFormat4',
388
387
             {'bzrdir_format': formats[0]._matchingbzrdir,
389
388
              'transport_readonly_server': 'b',
390
389
              'transport_server': 'a',
450
449
        # ones to add.
451
450
        from bzrlib.tests.per_tree import (
452
451
            return_parameter,
453
 
            revision_tree_from_workingtree
454
452
            )
455
453
        from bzrlib.tests.per_intertree import (
456
454
            make_scenarios,
457
455
            )
458
 
        from bzrlib.workingtree import WorkingTreeFormat2, WorkingTreeFormat3
 
456
        from bzrlib.workingtree import WorkingTreeFormat3, WorkingTreeFormat4
459
457
        input_test = TestInterTreeScenarios(
460
458
            "test_scenarios")
461
459
        server1 = "a"
462
460
        server2 = "b"
463
 
        format1 = WorkingTreeFormat2()
 
461
        format1 = WorkingTreeFormat4()
464
462
        format2 = WorkingTreeFormat3()
465
463
        formats = [("1", str, format1, format2, "converter1"),
466
464
            ("2", int, format2, format1, "converter2")]
557
555
    def test_make_branch_and_memory_tree_with_format(self):
558
556
        """make_branch_and_memory_tree should accept a format option."""
559
557
        format = bzrdir.BzrDirMetaFormat1()
560
 
        format.repository_format = weaverepo.RepositoryFormat7()
 
558
        format.repository_format = repository.format_registry.get_default()
561
559
        tree = self.make_branch_and_memory_tree('dir', format=format)
562
560
        # Guard against regression into MemoryTransport leaking
563
561
        # files to disk instead of keeping them in memory.
577
575
        # Use a repo layout that doesn't conform to a 'named' layout, to ensure
578
576
        # that the format objects are used.
579
577
        format = bzrdir.BzrDirMetaFormat1()
580
 
        repo_format = weaverepo.RepositoryFormat7()
 
578
        repo_format = repository.format_registry.get_default()
581
579
        format.repository_format = repo_format
582
580
        builder = self.make_branch_builder('dir', format=format)
583
581
        the_branch = builder.get_branch()
1977
1975
    def test_make_branch_and_tree_with_format(self):
1978
1976
        # we should be able to supply a format to make_branch_and_tree
1979
1977
        self.make_branch_and_tree('a', format=bzrlib.bzrdir.BzrDirMetaFormat1())
1980
 
        self.make_branch_and_tree('b', format=bzrlib.bzrdir.BzrDirFormat6())
1981
1978
        self.assertIsInstance(bzrlib.bzrdir.BzrDir.open('a')._format,
1982
1979
                              bzrlib.bzrdir.BzrDirMetaFormat1)
1983
 
        self.assertIsInstance(bzrlib.bzrdir.BzrDir.open('b')._format,
1984
 
                              bzrlib.bzrdir.BzrDirFormat6)
1985
1980
 
1986
1981
    def test_make_branch_and_memory_tree(self):
1987
1982
        # we should be able to get a new branch and a mutable tree from