~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_serve.py

  • Committer: Andrew Bennetts
  • Date: 2011-03-18 01:12:17 UTC
  • mto: (5609.24.3 2.3)
  • mto: This revision was merged to the branch mainline in revision 5732.
  • Revision ID: andrew.bennetts@canonical.com-20110318011217-h1206xizh4kj1ldw
Alternative fix: cache the result of get_master_branch for the lifetime of the branch lock.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
"""Tests of the bzr serve command."""
19
19
 
20
20
import os
 
21
import os.path
21
22
import signal
 
23
import subprocess
 
24
import sys
22
25
import thread
23
26
import threading
24
27
 
25
28
from bzrlib import (
26
29
    builtins,
 
30
    debug,
27
31
    errors,
28
32
    osutils,
29
33
    revision as _mod_revision,
33
37
from bzrlib.branch import Branch
34
38
from bzrlib.bzrdir import BzrDir
35
39
from bzrlib.smart import client, medium
36
 
from bzrlib.smart.server import (
37
 
    BzrServerFactory,
38
 
    SmartTCPServer,
39
 
    )
 
40
from bzrlib.smart.server import BzrServerFactory, SmartTCPServer
40
41
from bzrlib.tests import (
41
42
    TestCaseWithMemoryTransport,
42
43
    TestCaseWithTransport,
 
44
    TestSkipped,
43
45
    )
44
46
from bzrlib.trace import mutter
45
47
from bzrlib.transport import remote
51
53
                                *func_args, **func_kwargs):
52
54
        """Run 'bzr serve', and run the given func in a thread once the server
53
55
        has started.
54
 
 
 
56
        
55
57
        When 'func' terminates, the server will be terminated too.
56
 
 
 
58
        
57
59
        Returns stdout and stderr.
58
60
        """
59
61
        # install hook
162
164
        url = 'bzr://localhost:%d/' % port
163
165
        self.permit_url(url)
164
166
        return process, url
165
 
 
 
167
    
166
168
    def test_bzr_serve_quiet(self):
167
169
        self.make_branch('.')
168
170
        args = ['--port', 'localhost:0', '--quiet']
332
334
        self.assertEqual(base_url, self.bzr_serve_transport.base)
333
335
        self.assertEqual(base_dir,
334
336
            server_maker.get_base_path(self.bzr_serve_transport))
 
337