/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2008-07-08 14:55:19 UTC
  • mfrom: (3530 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3532.
  • Revision ID: john@arbash-meinel.com-20080708145519-paqg4kjwbpgs2xmq
Merge bzr.dev 3530

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
                           )
34
34
from bzrlib.remote import RemoteBranchFormat, RemoteBzrDirFormat
35
35
from bzrlib.smart.server import (
 
36
    ReadonlySmartTCPServer_for_testing,
 
37
    ReadonlySmartTCPServer_for_testing_v2_only,
36
38
    SmartTCPServer_for_testing,
37
 
    ReadonlySmartTCPServer_for_testing,
 
39
    SmartTCPServer_for_testing_v2_only,
38
40
    )
39
41
from bzrlib.tests.bzrdir_implementations.test_bzrdir import TestCaseWithBzrDir
40
42
from bzrlib.transport.memory import MemoryServer
50
52
    """
51
53
 
52
54
    def __init__(self, transport_server, transport_readonly_server, formats,
53
 
        vfs_transport_factory=None):
 
55
        vfs_transport_factory=None, name_suffix=''):
54
56
        self._transport_server = transport_server
55
57
        self._transport_readonly_server = transport_readonly_server
 
58
        self._name_suffix = name_suffix
56
59
        self.scenarios = self.formats_to_scenarios(formats)
57
60
    
58
61
    def formats_to_scenarios(self, formats):
66
69
            # so we have a conditional here to handle them.
67
70
            scenario_name = getattr(branch_format, '__name__',
68
71
                branch_format.__class__.__name__)
 
72
            scenario_name += self._name_suffix
69
73
            scenario = (scenario_name, {
70
74
                "transport_server":self._transport_server,
71
75
                "transport_readonly_server":self._transport_readonly_server,
135
139
        return tree
136
140
 
137
141
 
138
 
def test_suite():
139
 
    result = tests.TestSuite()
 
142
def load_tests(basic_tests, module, loader):
 
143
    result = loader.suiteClass()
 
144
    # add the tests for this module
 
145
    result.addTests(basic_tests)
 
146
 
140
147
    test_branch_implementations = [
141
148
        'bzrlib.tests.branch_implementations.test_bound_sftp',
142
149
        'bzrlib.tests.branch_implementations.test_branch',
143
150
        'bzrlib.tests.branch_implementations.test_break_lock',
 
151
        'bzrlib.tests.branch_implementations.test_check',
144
152
        'bzrlib.tests.branch_implementations.test_create_checkout',
145
153
        'bzrlib.tests.branch_implementations.test_commit',
146
154
        'bzrlib.tests.branch_implementations.test_get_revision_id_to_revno_map',
152
160
        'bzrlib.tests.branch_implementations.test_permissions',
153
161
        'bzrlib.tests.branch_implementations.test_pull',
154
162
        'bzrlib.tests.branch_implementations.test_push',
 
163
        'bzrlib.tests.branch_implementations.test_reconcile',
155
164
        'bzrlib.tests.branch_implementations.test_revision_history',
156
165
        'bzrlib.tests.branch_implementations.test_revision_id_to_revno',
157
166
        'bzrlib.tests.branch_implementations.test_sprout',
170
179
        # by the TestCaseWithTransport.get_readonly_transport method.
171
180
        None,
172
181
        combinations)
173
 
    loader = tests.TestLoader()
 
182
    # add the tests for the sub modules
174
183
    tests.adapt_modules(test_branch_implementations, adapter, loader, result)
175
184
 
 
185
    # Add RemoteBranch tests, which need a special server.
176
186
    adapt_to_smart_server = BranchTestProviderAdapter(
177
187
        SmartTCPServer_for_testing,
178
188
        ReadonlySmartTCPServer_for_testing,
179
189
        [(RemoteBranchFormat(), RemoteBzrDirFormat())],
180
 
        MemoryServer
181
 
        )
 
190
        MemoryServer,
 
191
        name_suffix='-default')
 
192
    tests.adapt_modules(test_branch_implementations,
 
193
                        adapt_to_smart_server,
 
194
                        loader,
 
195
                        result)
 
196
 
 
197
    # Also add tests for RemoteBranch with HPSS protocol v2 (i.e. bzr <1.6)
 
198
    # server.
 
199
    adapt_to_smart_server = BranchTestProviderAdapter(
 
200
        SmartTCPServer_for_testing_v2_only,
 
201
        ReadonlySmartTCPServer_for_testing_v2_only,
 
202
        [(RemoteBranchFormat(), RemoteBzrDirFormat())],
 
203
        MemoryServer,
 
204
        name_suffix='-v2')
182
205
    tests.adapt_modules(test_branch_implementations,
183
206
                        adapt_to_smart_server,
184
207
                        loader,