~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.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:
54
54
    )
55
55
from bzrlib.repofmt import groupcompress_repo, pack_repo
56
56
from bzrlib.revision import NULL_REVISION
57
 
from bzrlib.smart import server, medium
 
57
from bzrlib.smart import medium
58
58
from bzrlib.smart.client import _SmartClient
59
59
from bzrlib.smart.repository import SmartServerRepositoryGetParentMap
60
60
from bzrlib.tests import (
61
61
    condition_isinstance,
62
62
    split_suite_by_condition,
63
63
    multiply_tests,
 
64
    test_server,
64
65
    )
65
66
from bzrlib.transport import get_transport
66
67
from bzrlib.transport.memory import MemoryTransport
75
76
        standard_tests, condition_isinstance(BasicRemoteObjectTests))
76
77
    smart_server_version_scenarios = [
77
78
        ('HPSS-v2',
78
 
            {'transport_server': server.SmartTCPServer_for_testing_v2_only}),
 
79
         {'transport_server': test_server.SmartTCPServer_for_testing_v2_only}),
79
80
        ('HPSS-v3',
80
 
            {'transport_server': server.SmartTCPServer_for_testing})]
 
81
         {'transport_server': test_server.SmartTCPServer_for_testing})]
81
82
    return multiply_tests(to_adapt, smart_server_version_scenarios, result)
82
83
 
83
84
 
2008
2009
        self.assertLength(1, self.hpss_calls)
2009
2010
 
2010
2011
    def disableExtraResults(self):
2011
 
        old_flag = SmartServerRepositoryGetParentMap.no_extra_results
2012
 
        SmartServerRepositoryGetParentMap.no_extra_results = True
2013
 
        def reset_values():
2014
 
            SmartServerRepositoryGetParentMap.no_extra_results = old_flag
2015
 
        self.addCleanup(reset_values)
 
2012
        self.overrideAttr(SmartServerRepositoryGetParentMap,
 
2013
                          'no_extra_results', True)
2016
2014
 
2017
2015
    def test_null_cached_missing_and_stop_key(self):
2018
2016
        self.setup_smart_server_with_call_log()
2077
2075
 
2078
2076
    def test_allows_new_revisions(self):
2079
2077
        """get_parent_map's results can be updated by commit."""
2080
 
        smart_server = server.SmartTCPServer_for_testing()
 
2078
        smart_server = test_server.SmartTCPServer_for_testing()
2081
2079
        self.start_server(smart_server)
2082
2080
        self.make_branch('branch')
2083
2081
        branch = Branch.open(smart_server.get_url() + '/branch')
2625
2623
    """RemoteRepository.copy_content_into optimizations"""
2626
2624
 
2627
2625
    def test_copy_content_remote_to_local(self):
2628
 
        self.transport_server = server.SmartTCPServer_for_testing
 
2626
        self.transport_server = test_server.SmartTCPServer_for_testing
2629
2627
        src_repo = self.make_repository('repo1')
2630
2628
        src_repo = repository.Repository.open(self.get_url('repo1'))
2631
2629
        # At the moment the tarball-based copy_content_into can't write back
2944
2942
        stacked_branch = self.make_branch('stacked', format='1.9')
2945
2943
        stacked_branch.set_stacked_on_url('../base')
2946
2944
        # start a server looking at this
2947
 
        smart_server = server.SmartTCPServer_for_testing()
 
2945
        smart_server = test_server.SmartTCPServer_for_testing()
2948
2946
        self.start_server(smart_server)
2949
2947
        remote_bzrdir = BzrDir.open(smart_server.get_url() + '/stacked')
2950
2948
        # can get its branch and repository
3106
3104
        super(TestRemoteBranchEffort, self).setUp()
3107
3105
        # Create a smart server that publishes whatever the backing VFS server
3108
3106
        # does.
3109
 
        self.smart_server = server.SmartTCPServer_for_testing()
 
3107
        self.smart_server = test_server.SmartTCPServer_for_testing()
3110
3108
        self.start_server(self.smart_server, self.get_server())
3111
3109
        # Log all HPSS calls into self.hpss_calls.
3112
3110
        _SmartClient.hooks.install_named_hook(