75
76
# test the default InterBranch between format 6 and the current
77
78
for optimiser_class in InterBranch._optimisers:
78
for format_from_test, format_to_test in \
79
optimiser_class._get_branch_formats_to_test():
80
result.append((optimiser_class, format_from_test, format_to_test))
79
format_from_test, format_to_test = \
80
optimiser_class._get_branch_formats_to_test()
81
if format_to_test is not None:
82
result.append((optimiser_class,
83
format_from_test, format_to_test))
81
84
# if there are specific combinations we want to use, we can add them
141
144
return newbranch.bzrdir
144
class StubWithFormat(object):
145
"""A stub object used to check that convenience methods call Inter's."""
150
class StubMatchingInter(object):
151
"""An inter for tests.
153
This is not a subclass of InterBranch so that missing methods are caught
154
and added rather than actually trying to do something.
159
def __init__(self, source, target):
164
def is_compatible(klass, source, target):
165
return StubWithFormat._format in (source._format, target._format)
167
def copy_content_into(self, *args, **kwargs):
168
self.__class__._uses.append(
169
(self, 'copy_content_into', args, kwargs))
172
147
def load_tests(standard_tests, module, loader):
173
148
submod_tests = loader.loadTestsFromModuleNames([
174
'bzrlib.tests.per_interbranch.test_get',
175
'bzrlib.tests.per_interbranch.test_copy_content_into',
176
149
'bzrlib.tests.per_interbranch.test_pull',
177
150
'bzrlib.tests.per_interbranch.test_push',
178
151
'bzrlib.tests.per_interbranch.test_update_revisions',