~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
import bzrlib
26
26
import bzrlib.errors as errors
27
27
from bzrlib.transport import get_transport
 
28
from bzrlib.transform import TransformPreview
28
29
from bzrlib.tests import (
29
30
                          adapt_modules,
30
31
                          default_transport,
43
44
    )
44
45
 
45
46
 
46
 
def return_provided_trees(source, target):
 
47
def return_provided_trees(test_case, source, target):
47
48
    """Return the source and target tree unaltered."""
48
49
    return source, target
49
50
 
93
94
            result.append(scenario)
94
95
        return result
95
96
 
 
97
def mutable_trees_to_preview_trees(test_case, source, target):
 
98
    preview = TransformPreview(target)
 
99
    test_case.addCleanup(preview.finalize)
 
100
    return source, preview.get_preview_tree()
96
101
 
97
102
def load_tests(basic_tests, module, loader):
98
103
    result = loader.suiteClass()
132
137
                 optimiser._matching_from_tree_format,
133
138
                 optimiser._matching_to_tree_format,
134
139
                 optimiser._test_mutable_trees_to_test_trees))
 
140
    # PreviewTree does not have an InterTree optimiser class.
 
141
    test_intertree_permutations.append(
 
142
        (InterTree.__name__ + "(PreviewTree)",
 
143
         InterTree,
 
144
         default_tree_format,
 
145
         default_tree_format,
 
146
         mutable_trees_to_preview_trees))
135
147
    adapter = InterTreeTestProviderAdapter(
136
148
        default_transport,
137
149
        # None here will cause a readonly decorator to be created