~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: 2010-10-08 04:25:10 UTC
  • mto: This revision was merged to the branch mainline in revision 5472.
  • Revision ID: andrew.bennetts@canonical.com-20101008042510-sg9vdhmnggilzxsk
Fix stray TAB in source.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2011 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
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']
223
225
        # -Dhpss, and does drop some hpss logging to the file.
224
226
        self.make_branch('.')
225
227
        log_fname = os.getcwd() + '/server.log'
226
 
        self.overrideEnv('BZR_LOG', log_fname)
 
228
        self._captureVar('BZR_LOG', log_fname)
227
229
        process, transport = self.start_server_inet(['-Dhpss'])
228
230
        branch = BzrDir.open_from_transport(transport).open_branch()
229
231
        self.make_read_requests(branch)
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