/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 bzrlib/tests/blackbox/test_serve.py

  • Committer: Martin Pool
  • Date: 2010-10-08 04:38:25 UTC
  • mfrom: (5462 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5478.
  • Revision ID: mbp@sourcefrog.net-20101008043825-b181r8bo5r3qwb6j
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 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
31
31
    errors,
32
32
    osutils,
33
33
    revision as _mod_revision,
 
34
    transport,
34
35
    urlutils,
35
36
    )
36
37
from bzrlib.branch import Branch
38
39
from bzrlib.smart import client, medium
39
40
from bzrlib.smart.server import BzrServerFactory, SmartTCPServer
40
41
from bzrlib.tests import (
41
 
    ParamikoFeature,
42
42
    TestCaseWithMemoryTransport,
43
43
    TestCaseWithTransport,
44
44
    TestSkipped,
45
45
    )
46
46
from bzrlib.trace import mutter
47
 
from bzrlib.transport import get_transport, remote
 
47
from bzrlib.transport import remote
48
48
 
49
49
 
50
50
class TestBzrServeBase(TestCaseWithTransport):
193
193
    def test_bzr_serve_port_readonly(self):
194
194
        """bzr server should provide a read only filesystem by default."""
195
195
        process, url = self.start_server_port()
196
 
        transport = get_transport(url)
197
 
        self.assertRaises(errors.TransportNotPossible, transport.mkdir, 'adir')
 
196
        t = transport.get_transport(url)
 
197
        self.assertRaises(errors.TransportNotPossible, t.mkdir, 'adir')
198
198
        self.assertServerFinishesCleanly(process)
199
199
 
200
200
    def test_bzr_serve_port_readwrite(self):
233
233
        f = open(log_fname, 'rb')
234
234
        content = f.read()
235
235
        f.close()
236
 
        self.assertContainsRe(content, 'hpss request: \[')
 
236
        self.assertContainsRe(content, r'hpss request: \[[0-9-]+\]')
237
237
 
238
238
 
239
239
class TestCmdServeChrooting(TestBzrServeBase):
288
288
        return path
289
289
 
290
290
    def make_test_server(self, base_path='/'):
291
 
        """Make and setUp a BzrServerFactory, backed by a memory transport, and
 
291
        """Make and start a BzrServerFactory, backed by a memory transport, and
292
292
        creat '/home/user' in that transport.
293
293
        """
294
294
        bzr_server = BzrServerFactory(