/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/interrepository_implementations/__init__.py

  • Committer: Aaron Bentley
  • Date: 2009-03-09 02:16:29 UTC
  • mfrom: (4090 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4100.
  • Revision ID: aaron@aaronbentley.com-20090309021629-o4j18ltv1hzuuyhl
Merge bzr.dev into clean-tree2

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
These test the conformance of all the interrepository variations to the
23
23
expected API including generally applicable corner cases.
24
 
Specific tests for individual formats are in the tests/test_repository.py file 
 
24
Specific tests for individual formats are in the tests/test_repository.py file
25
25
rather than in tests/interrepository_implementations/*.py.
26
26
"""
27
27
 
33
33
 
34
34
from bzrlib.repository import (
35
35
                               InterKnitRepo,
36
 
                               InterKnit1and2,
37
 
                               InterModel1and2,
38
36
                               InterRepository,
39
37
                               )
40
38
from bzrlib.tests import (
50
48
    """A tool to generate a suite testing multiple inter repository formats.
51
49
 
52
50
    This is done by copying the test once for each interrepo provider and injecting
53
 
    the transport_server, transport_readonly_server, repository_format and 
 
51
    the transport_server, transport_readonly_server, repository_format and
54
52
    repository_to_format classes into each copy.
55
53
    Each copy is also given a new id() to make it easy to identify.
56
54
    """
60
58
        self._transport_server = transport_server
61
59
        self._transport_readonly_server = transport_readonly_server
62
60
        self.scenarios = self.formats_to_scenarios(formats)
63
 
    
 
61
 
64
62
    def formats_to_scenarios(self, formats):
65
63
        """Transform the input formats to a list of scenarios.
66
64
 
81
79
                 })
82
80
            result.append(scenario)
83
81
        return result
84
 
    
 
82
 
85
83
    @staticmethod
86
84
    def default_test_list():
87
85
        """Generate the default list of interrepo permutations to test."""
88
86
        from bzrlib.repofmt import knitrepo, pack_repo, weaverepo
89
87
        result = []
90
 
        # test the default InterRepository between format 6 and the current 
 
88
        # test the default InterRepository between format 6 and the current
91
89
        # default format.
92
90
        # XXX: robertc 20060220 reinstate this when there are two supported
93
91
        # formats which do not have an optimal code path between them.
99
97
            if format_to_test is not None:
100
98
                result.append((optimiser_class,
101
99
                               format_to_test, format_to_test))
102
 
        # if there are specific combinations we want to use, we can add them 
103
 
        # here.
104
 
        result.append((InterModel1and2,
 
100
        # if there are specific combinations we want to use, we can add them
 
101
        # here. We want to test rich root upgrading.
 
102
        result.append((InterRepository,
105
103
                       weaverepo.RepositoryFormat5(),
106
104
                       knitrepo.RepositoryFormatKnit3()))
107
 
        result.append((InterModel1and2,
 
105
        result.append((InterRepository,
108
106
                       knitrepo.RepositoryFormatKnit1(),
109
107
                       knitrepo.RepositoryFormatKnit3()))
110
 
        result.append((InterKnit1and2,
 
108
        result.append((InterRepository,
111
109
                       knitrepo.RepositoryFormatKnit1(),
112
110
                       knitrepo.RepositoryFormatKnit3()))
113
111
        result.append((InterKnitRepo,