Rev 4110: (robertc) Factor branch scenario generation out of branch test in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Mar 11 01:56:40 GMT 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4110
revision-id: pqm at pqm.ubuntu.com-20090311015637-v73ocbv9bcexe4dm
parent: pqm at pqm.ubuntu.com-20090311011743-ei3fkpip8ecywy5k
parent: robertc at robertcollins.net-20090311005825-g7vks8wa4ldhnye7
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2009-03-11 01:56:37 +0000
message:
  (robertc) Factor branch scenario generation out of branch test
  	loading. (Michael Hudson)
modified:
  bzrlib/tests/branch_implementations/__init__.py __init__.py-20060123013057-b12a52c3f361daf4
    ------------------------------------------------------------
    revno: 4108.2.1
    revision-id: robertc at robertcollins.net-20090311005825-g7vks8wa4ldhnye7
    parent: pqm at pqm.ubuntu.com-20090310131846-8f45p0k6f0nftk31
    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:
      bzrlib/tests/branch_implementations/__init__.py __init__.py-20060123013057-b12a52c3f361daf4
=== 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