Rev 4109: Factor branch scenario generation out of branch test loading. in http://people.ubuntu.com/~robertc/baz2.0/integration

Robert Collins robertc at robertcollins.net
Wed Mar 11 00:58:30 GMT 2009


At http://people.ubuntu.com/~robertc/baz2.0/integration

------------------------------------------------------------
revno: 4109
revision-id: robertc at robertcollins.net-20090311005825-g7vks8wa4ldhnye7
parent: pqm at pqm.ubuntu.com-20090310131846-8f45p0k6f0nftk31
author: Michael Hudson <michael.hudson at canonical.com>
committer: Robert Collins <robertc at robertcollins.net>
branch nick: integration
timestamp: Wed 2009-03-11 11:58:25 +1100
message:
  Factor branch scenario generation out of branch test loading.
=== modified file 'bzrlib/tests/branch_implementations/__init__.py'
--- a/bzrlib/tests/branch_implementations/__init__.py	2009-03-07 06:58:17 +0000
+++ b/bzrlib/tests/branch_implementations/__init__.py	2009-03-11 00:58:25 +0000
@@ -130,6 +130,38 @@
         return tree
 
 
+def branch_scenarios():
+    """ """
+    # Generate a list of branch formats and their associated bzrdir formats to
+    # use.
+    combinations = [(format, format._matchingbzrdir) for format in
+         BranchFormat._formats.values() + _legacy_formats]
+    scenarios = make_scenarios(
+        # None here will cause the default vfs transport server to be used.
+        None,
+        # None here will cause a readonly decorator to be created
+        # by the TestCaseWithTransport.get_readonly_transport method.
+        None,
+        combinations)
+    # Add RemoteBranch tests, which need a special server.
+    remote_branch_format = RemoteBranchFormat()
+    scenarios.extend(make_scenarios(
+        SmartTCPServer_for_testing,
+        ReadonlySmartTCPServer_for_testing,
+        [(remote_branch_format, remote_branch_format._matchingbzrdir)],
+        MemoryServer,
+        name_suffix='-default'))
+    # Also add tests for RemoteBranch with HPSS protocol v2 (i.e. bzr <1.6)
+    # server.
+    scenarios.extend(make_scenarios(
+        SmartTCPServer_for_testing_v2_only,
+        ReadonlySmartTCPServer_for_testing_v2_only,
+        [(remote_branch_format, remote_branch_format._matchingbzrdir)],
+        MemoryServer,
+        name_suffix='-v2'))
+    return scenarios
+
+
 def load_tests(standard_tests, module, loader):
     test_branch_implementations = [
         'bzrlib.tests.branch_implementations.test_bound_sftp',
@@ -161,32 +193,4 @@
         'bzrlib.tests.branch_implementations.test_update',
         ]
     sub_tests = loader.loadTestsFromModuleNames(test_branch_implementations)
-    # Generate a list of branch formats and their associated bzrdir formats to
-    # use.
-    combinations = [(format, format._matchingbzrdir) for format in
-         BranchFormat._formats.values() + _legacy_formats]
-    scenarios = make_scenarios(
-        # None here will cause the default vfs transport server to be used.
-        None,
-        # None here will cause a readonly decorator to be created
-        # by the TestCaseWithTransport.get_readonly_transport method.
-        None,
-        combinations)
-    # Add RemoteBranch tests, which need a special server.
-    remote_branch_format = RemoteBranchFormat()
-    scenarios.extend(make_scenarios(
-        SmartTCPServer_for_testing,
-        ReadonlySmartTCPServer_for_testing,
-        [(remote_branch_format, remote_branch_format._matchingbzrdir)],
-        MemoryServer,
-        name_suffix='-default'))
-    # Also add tests for RemoteBranch with HPSS protocol v2 (i.e. bzr <1.6)
-    # server.
-    scenarios.extend(make_scenarios(
-        SmartTCPServer_for_testing_v2_only,
-        ReadonlySmartTCPServer_for_testing_v2_only,
-        [(remote_branch_format, remote_branch_format._matchingbzrdir)],
-        MemoryServer,
-        name_suffix='-v2'))
-    # add the tests for the sub modules
-    return tests.multiply_tests(sub_tests, scenarios, standard_tests)
+    return tests.multiply_tests(sub_tests, branch_scenarios(), standard_tests)




More information about the bazaar-commits mailing list