15
15
# You should have received a copy of the GNU General Public License
16
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
20
"""Branch implementation tests for bzr.
133
def branch_scenarios():
135
# Generate a list of branch formats and their associated bzrdir formats to
137
combinations = [(format, format._matchingbzrdir) for format in
138
BranchFormat._formats.values() + _legacy_formats]
139
scenarios = make_scenarios(
140
# None here will cause the default vfs transport server to be used.
142
# None here will cause a readonly decorator to be created
143
# by the TestCaseWithTransport.get_readonly_transport method.
146
# Add RemoteBranch tests, which need a special server.
147
remote_branch_format = RemoteBranchFormat()
148
scenarios.extend(make_scenarios(
149
SmartTCPServer_for_testing,
150
ReadonlySmartTCPServer_for_testing,
151
[(remote_branch_format, remote_branch_format._matchingbzrdir)],
153
name_suffix='-default'))
154
# Also add tests for RemoteBranch with HPSS protocol v2 (i.e. bzr <1.6)
156
scenarios.extend(make_scenarios(
157
SmartTCPServer_for_testing_v2_only,
158
ReadonlySmartTCPServer_for_testing_v2_only,
159
[(remote_branch_format, remote_branch_format._matchingbzrdir)],
133
165
def load_tests(standard_tests, module, loader):
134
166
test_branch_implementations = [
135
167
'bzrlib.tests.branch_implementations.test_bound_sftp',
161
193
'bzrlib.tests.branch_implementations.test_update',
163
195
sub_tests = loader.loadTestsFromModuleNames(test_branch_implementations)
164
# Generate a list of branch formats and their associated bzrdir formats to
166
combinations = [(format, format._matchingbzrdir) for format in
167
BranchFormat._formats.values() + _legacy_formats]
168
scenarios = make_scenarios(
169
# None here will cause the default vfs transport server to be used.
171
# None here will cause a readonly decorator to be created
172
# by the TestCaseWithTransport.get_readonly_transport method.
175
# Add RemoteBranch tests, which need a special server.
176
remote_branch_format = RemoteBranchFormat()
177
scenarios.extend(make_scenarios(
178
SmartTCPServer_for_testing,
179
ReadonlySmartTCPServer_for_testing,
180
[(remote_branch_format, remote_branch_format._matchingbzrdir)],
182
name_suffix='-default'))
183
# Also add tests for RemoteBranch with HPSS protocol v2 (i.e. bzr <1.6)
185
scenarios.extend(make_scenarios(
186
SmartTCPServer_for_testing_v2_only,
187
ReadonlySmartTCPServer_for_testing_v2_only,
188
[(remote_branch_format, remote_branch_format._matchingbzrdir)],
191
# add the tests for the sub modules
192
return tests.multiply_tests(sub_tests, scenarios, standard_tests)
196
return tests.multiply_tests(sub_tests, branch_scenarios(), standard_tests)