/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2017-05-22 00:56:52 UTC
  • mfrom: (6621.2.26 py3_pokes)
  • Revision ID: jelmer@jelmer.uk-20170522005652-yjahcr9hwmjkno7n
Merge Python3 porting work ('py3 pokes')

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import thread
24
24
import threading
25
25
 
26
 
from breezy import (
 
26
from ... import (
27
27
    builtins,
28
28
    config,
29
29
    errors,
33
33
    transport,
34
34
    urlutils,
35
35
    )
36
 
from breezy.branch import Branch
37
 
from breezy.controldir import ControlDir
38
 
from breezy.smart import client, medium
39
 
from breezy.smart.server import (
 
36
from ...branch import Branch
 
37
from ...controldir import ControlDir
 
38
from ...smart import client, medium
 
39
from ...smart.server import (
40
40
    BzrServerFactory,
41
41
    SmartTCPServer,
42
42
    )
43
 
from breezy.tests import (
 
43
from .. import (
44
44
    TestCaseWithMemoryTransport,
45
45
    TestCaseWithTransport,
46
46
    )
47
 
from breezy.transport import remote
 
47
from ...transport import remote
48
48
 
49
49
 
50
50
class TestBzrServeBase(TestCaseWithTransport):
70
70
                if func is not None:
71
71
                    try:
72
72
                        func(*func_args, **func_kwargs)
73
 
                    except Exception, e:
 
73
                    except Exception as e:
74
74
                        # Log errors to make some test failures a little less
75
75
                        # mysterious.
76
76
                        trace.mutter('func broke: %r', e)
96
96
        try:
97
97
            out, err = self.run_bzr(['serve'] + list(serve_args),
98
98
                                    retcode=retcode)
99
 
        except KeyboardInterrupt, e:
100
 
            out, err = e.args
 
99
        except KeyboardInterrupt as e:
 
100
            return (self._last_cmd_stdout.getvalue(),
 
101
                self._last_cmd_stderr.getvalue())
101
102
        return out, err
102
103
 
103
104
 
260
261
        # This is a smoke test that the server doesn't crash when run with
261
262
        # -Dhpss, and does drop some hpss logging to the file.
262
263
        self.make_branch('.')
263
 
        log_fname = os.getcwd() + '/server.log'
 
264
        log_fname = self.test_dir + '/server.log'
264
265
        self.overrideEnv('BRZ_LOG', log_fname)
265
266
        process, transport = self.start_server_inet(['-Dhpss'])
266
267
        branch = ControlDir.open_from_transport(transport).open_branch()
373
374
        resp = smart_client.call('BzrDirFormat.initialize', 'foo/')
374
375
        try:
375
376
            resp = smart_client.call('BzrDir.find_repositoryV3', 'foo/')
376
 
        except errors.ErrorFromSmartServer, e:
 
377
        except errors.ErrorFromSmartServer as e:
377
378
            resp = e.error_tuple
378
379
        self.client_resp = resp
379
380
        client_medium.disconnect()