~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2010-04-08 04:34:03 UTC
  • mfrom: (5138 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5139.
  • Revision ID: robertc@robertcollins.net-20100408043403-56z0d07vdqrx7f3t
Update bugfix for 528114 to trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
# Authors: Robert Collins <robert.collins@canonical.com>
3
3
#          and others
4
4
#
32
32
                           _legacy_formats,
33
33
                           )
34
34
from bzrlib.remote import RemoteBranchFormat, RemoteBzrDirFormat
35
 
from bzrlib.smart.server import (
36
 
    ReadonlySmartTCPServer_for_testing,
37
 
    ReadonlySmartTCPServer_for_testing_v2_only,
38
 
    SmartTCPServer_for_testing,
39
 
    SmartTCPServer_for_testing_v2_only,
40
 
    )
 
35
from bzrlib.tests import test_server
41
36
from bzrlib.tests.per_bzrdir.test_bzrdir import TestCaseWithBzrDir
42
 
from bzrlib.transport.memory import MemoryServer
 
37
from bzrlib.transport import memory
43
38
 
44
39
 
45
40
def make_scenarios(transport_server, transport_readonly_server,
66
61
 
67
62
 
68
63
class TestCaseWithBranch(TestCaseWithBzrDir):
69
 
    """This helper will be parameterised in each branch_implementation test."""
 
64
    """This helper will be parameterised in each per_branch test."""
70
65
 
71
66
    def setUp(self):
72
67
        super(TestCaseWithBranch, self).setUp()
148
143
    # Add RemoteBranch tests, which need a special server.
149
144
    remote_branch_format = RemoteBranchFormat()
150
145
    scenarios.extend(make_scenarios(
151
 
        SmartTCPServer_for_testing,
152
 
        ReadonlySmartTCPServer_for_testing,
 
146
        test_server.SmartTCPServer_for_testing,
 
147
        test_server.ReadonlySmartTCPServer_for_testing,
153
148
        [(remote_branch_format, remote_branch_format._matchingbzrdir)],
154
 
        MemoryServer,
 
149
        memory.MemoryServer,
155
150
        name_suffix='-default'))
156
151
    # Also add tests for RemoteBranch with HPSS protocol v2 (i.e. bzr <1.6)
157
152
    # server.
158
153
    scenarios.extend(make_scenarios(
159
 
        SmartTCPServer_for_testing_v2_only,
160
 
        ReadonlySmartTCPServer_for_testing_v2_only,
 
154
        test_server.SmartTCPServer_for_testing_v2_only,
 
155
        test_server.ReadonlySmartTCPServer_for_testing_v2_only,
161
156
        [(remote_branch_format, remote_branch_format._matchingbzrdir)],
162
 
        MemoryServer,
 
157
        memory.MemoryServer,
163
158
        name_suffix='-v2'))
164
159
    return scenarios
165
160