~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Robert Collins
  • Date: 2009-02-19 01:41:43 UTC
  • mto: This revision was merged to the branch mainline in revision 4020.
  • Revision ID: robertc@robertcollins.net-20090219014143-wv42sc7z71wbhht0
Add BzrDirFormatMeta1 test for the amount of rpc calls made initializing over the network.

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
from bzrlib.merge import merge_inner
77
77
import bzrlib.merge3
78
78
import bzrlib.plugin
 
79
from bzrlib.smart import client, server
79
80
import bzrlib.store
80
81
from bzrlib import symbol_versioning
81
82
from bzrlib.symbol_versioning import (
2041
2042
        self.__server = None
2042
2043
        self.reduceLockdirTimeout()
2043
2044
 
 
2045
    def setup_smart_server_with_call_log(self):
 
2046
        """Sets up a smart server as the transport server with a call log."""
 
2047
        self.transport_server = server.SmartTCPServer_for_testing
 
2048
        self.hpss_calls = []
 
2049
        def capture_hpss_call(params):
 
2050
            import traceback
 
2051
            self.hpss_calls.append((params, traceback.format_stack()))
 
2052
        client._SmartClient.hooks.install_named_hook(
 
2053
            'call', capture_hpss_call, None)
 
2054
 
 
2055
    def reset_smart_call_log(self):
 
2056
        self.hpss_calls = []
 
2057
 
2044
2058
     
2045
2059
class TestCaseInTempDir(TestCaseWithMemoryTransport):
2046
2060
    """Derived class that runs a test within a temporary directory.