Exemple #1
0
def load_tests(standard_tests, module, loader):
    test_per_bzrdir = [
        'bzrlib.tests.per_bzrdir.test_bzrdir',
        ]
    submod_tests = loader.loadTestsFromModuleNames(test_per_bzrdir)
    formats = [format for format in ControlDirFormat.known_formats()
               if isinstance(format, BzrDirFormat)]
    scenarios = make_scenarios(
        default_transport,
        None,
        # None here will cause a readonly decorator to be created
        # by the TestCaseWithTransport.get_readonly_transport method.
        None,
        formats)
    # This will always add scenarios using the smart server.
    from bzrlib.remote import RemoteBzrDirFormat
    # test the remote server behaviour when backed with a MemoryTransport
    # Once for the current version
    scenarios.extend(make_scenarios(
        memory.MemoryServer,
        test_server.SmartTCPServer_for_testing,
        test_server.ReadonlySmartTCPServer_for_testing,
        [(RemoteBzrDirFormat())],
        name_suffix='-default'))
    # And once with < 1.6 - the 'v2' protocol.
    scenarios.extend(make_scenarios(
        memory.MemoryServer,
        test_server.SmartTCPServer_for_testing_v2_only,
        test_server.ReadonlySmartTCPServer_for_testing_v2_only,
        [(RemoteBzrDirFormat())],
        name_suffix='-v2'))
    # add the tests for the sub modules
    return multiply_tests(submod_tests, scenarios, standard_tests)
Exemple #2
0
def load_tests(standard_tests, module, loader):
    colo_supported_formats = []
    colo_unsupported_formats = []
    # This will always add scenarios using the smart server.
    from bzrlib.remote import RemoteBzrDirFormat
    for format in ControlDirFormat.known_formats():
        if isinstance(format, RemoteBzrDirFormat):
            continue
        if format.colocated_branches:
            colo_supported_formats.append(format)
        else:
            colo_unsupported_formats.append(format)
    supported_scenarios = make_scenarios(default_transport, None, None,
        colo_supported_formats)
    unsupported_scenarios = make_scenarios(default_transport, None, None,
        colo_unsupported_formats)
    # test the remote server behaviour when backed with a MemoryTransport
    # Once for the current version
    unsupported_scenarios.extend(make_scenarios(
        memory.MemoryServer,
        test_server.SmartTCPServer_for_testing,
        test_server.ReadonlySmartTCPServer_for_testing,
        [(RemoteBzrDirFormat())],
        name_suffix='-default'))
    # And once with < 1.6 - the 'v2' protocol.
    unsupported_scenarios.extend(make_scenarios(
        memory.MemoryServer,
        test_server.SmartTCPServer_for_testing_v2_only,
        test_server.ReadonlySmartTCPServer_for_testing_v2_only,
        [(RemoteBzrDirFormat())],
        name_suffix='-v2'))

    result = loader.suiteClass()
    supported_tests = loader.loadTestsFromModuleNames([
        'bzrlib.tests.per_controldir_colo.test_supported'])
    unsupported_tests = loader.loadTestsFromModuleNames([
        'bzrlib.tests.per_controldir_colo.test_unsupported'])
    multiply_tests(supported_tests, supported_scenarios, result)
    multiply_tests(unsupported_tests, unsupported_scenarios, result)
    return result
Exemple #3
0
def load_tests(standard_tests, module, loader):
    colo_supported_formats = []
    colo_unsupported_formats = []
    # This will always add scenarios using the smart server.
    from bzrlib.remote import RemoteBzrDirFormat
    for format in ControlDirFormat.known_formats():
        if isinstance(format, RemoteBzrDirFormat):
            continue
        if format.colocated_branches:
            colo_supported_formats.append(format)
        else:
            colo_unsupported_formats.append(format)
    supported_scenarios = make_scenarios(default_transport, None, None,
                                         colo_supported_formats)
    unsupported_scenarios = make_scenarios(default_transport, None, None,
                                           colo_unsupported_formats)
    # test the remote server behaviour when backed with a MemoryTransport
    # Once for the current version
    unsupported_scenarios.extend(
        make_scenarios(memory.MemoryServer,
                       test_server.SmartTCPServer_for_testing,
                       test_server.ReadonlySmartTCPServer_for_testing,
                       [(RemoteBzrDirFormat())],
                       name_suffix='-default'))
    # And once with < 1.6 - the 'v2' protocol.
    unsupported_scenarios.extend(
        make_scenarios(memory.MemoryServer,
                       test_server.SmartTCPServer_for_testing_v2_only,
                       test_server.ReadonlySmartTCPServer_for_testing_v2_only,
                       [(RemoteBzrDirFormat())],
                       name_suffix='-v2'))

    result = loader.suiteClass()
    supported_tests = loader.loadTestsFromModuleNames(
        ['bzrlib.tests.per_controldir_colo.test_supported'])
    unsupported_tests = loader.loadTestsFromModuleNames(
        ['bzrlib.tests.per_controldir_colo.test_unsupported'])
    multiply_tests(supported_tests, supported_scenarios, result)
    multiply_tests(unsupported_tests, unsupported_scenarios, result)
    return result