/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/test_versionedfile.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-09 08:45:56 UTC
  • mfrom: (4084.5.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090309084556-9i2m12qlud2qcrtw
(robertc) Bulk update all test adaptation into a single approach
        using multiply_tests rather than many varied test adapters.
        (Robert Collins

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    TestCase,
49
49
    TestCaseWithMemoryTransport,
50
50
    TestNotApplicable,
51
 
    TestScenarioApplier,
52
51
    TestSkipped,
53
52
    condition_isinstance,
54
53
    split_suite_by_condition,
55
 
    iter_suite_tests,
 
54
    multiply_tests,
56
55
    )
57
56
from bzrlib.tests.http_utils import TestCaseWithWebserver
58
57
from bzrlib.trace import mutter
76
75
    """Parameterize VersionedFiles tests for different implementations."""
77
76
    to_adapt, result = split_suite_by_condition(
78
77
        standard_tests, condition_isinstance(TestVersionedFiles))
79
 
    len_one_adapter = TestScenarioApplier()
80
 
    len_two_adapter = TestScenarioApplier()
81
78
    # We want to be sure of behaviour for:
82
79
    # weaves prefix layout (weave texts)
83
80
    # individually named weaves (weave inventories)
88
85
    # individual graph knits in packs (inventories)
89
86
    # individual graph nocompression knits in packs (revisions)
90
87
    # plain text knits in packs (texts)
91
 
    len_one_adapter.scenarios = [
 
88
    len_one_scenarios = [
92
89
        ('weave-named', {
93
90
            'cleanup':None,
94
91
            'factory':make_versioned_files_factory(WeaveFile,
126
123
            'support_partial_insertion': False,
127
124
            }),
128
125
        ]
129
 
    len_two_adapter.scenarios = [
 
126
    len_two_scenarios = [
130
127
        ('weave-prefix', {
131
128
            'cleanup':None,
132
129
            'factory':make_versioned_files_factory(WeaveFile,
150
147
            'support_partial_insertion': True,
151
148
            }),
152
149
        ]
153
 
    for test in iter_suite_tests(to_adapt):
154
 
        result.addTests(len_one_adapter.adapt(test))
155
 
        result.addTests(len_two_adapter.adapt(test))
156
 
    return result
 
150
    scenarios = len_one_scenarios + len_two_scenarios
 
151
    return multiply_tests(to_adapt, scenarios, result)
157
152
 
158
153
 
159
154
def get_diamond_vf(f, trailing_eol=True, left_only=False):