~bzr/bzr/bzr.1.5

« back to all changes in this revision

Viewing changes to bzrlib/tests/bzrdir_implementations/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-05-08 23:03:13 UTC
  • mfrom: (3394.3.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20080508230313-knn3ibom6wt27w5k
(vila) Make the test suite use the new test loader

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
                          adapt_modules,
30
30
                          default_transport,
31
31
                          TestCaseWithTransport,
32
 
                          TestLoader,
33
32
                          TestScenarioApplier,
34
 
                          TestSuite,
35
33
                          )
36
34
from bzrlib.transport.memory import MemoryServer
37
35
 
92
90
            relpath, format=format)
93
91
 
94
92
 
95
 
def test_suite():
96
 
    result = TestSuite()
 
93
def load_tests(basic_tests, module, loader):
 
94
    result = loader.suiteClass()
 
95
    # add the tests for this module
 
96
    result.addTests(basic_tests)
 
97
 
97
98
    test_bzrdir_implementations = [
98
99
        'bzrlib.tests.bzrdir_implementations.test_bzrdir',
99
100
        ]
105
106
        # by the TestCaseWithTransport.get_readonly_transport method.
106
107
        None,
107
108
        formats)
108
 
    loader = TestLoader()
 
109
    # add the tests for the sub modules
109
110
    adapt_modules(test_bzrdir_implementations, adapter, loader, result)
110
111
 
111
112
    # This will always add the tests for smart server transport, regardless of
112
113
    # the --transport option the user specified to 'bzr selftest'.
113
 
    from bzrlib.smart.server import SmartTCPServer_for_testing, ReadonlySmartTCPServer_for_testing
 
114
    from bzrlib.smart.server import (
 
115
        SmartTCPServer_for_testing,
 
116
        ReadonlySmartTCPServer_for_testing,
 
117
        )
114
118
    from bzrlib.remote import RemoteBzrDirFormat
115
119
 
116
120
    # test the remote server behaviour using a MemoryTransport
117
 
    smart_server_suite = TestSuite()
 
121
    smart_server_suite = loader.suiteClass()
118
122
    adapt_to_smart_server = BzrDirTestProviderAdapter(
119
123
        MemoryServer,
120
124
        SmartTCPServer_for_testing,
122
126
        [(RemoteBzrDirFormat())])
123
127
    adapt_modules(test_bzrdir_implementations,
124
128
                  adapt_to_smart_server,
125
 
                  TestLoader(),
 
129
                  loader,
126
130
                  smart_server_suite)
127
131
    result.addTests(smart_server_suite)
128
132