~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-01-14 23:41:14 UTC
  • mfrom: (5611.1.3 bzr.dev)
  • Revision ID: pqm@pqm.ubuntu.com-20110114234114-r4hdusue691ekeg6
(jelmer) Cope with IPv6 addresses in ``bzr serve`` (Jelmer Vernooij)

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