~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2010-08-04 04:33:24 UTC
  • mto: This revision was merged to the branch mainline in revision 5390.
  • Revision ID: john@arbash-meinel.com-20100804043324-1ldc2v2w1kza7ox4
get into the nitty gritty for the _key_to_sha1 function.

It doesn't seem to help to op-out of the actual unhexlify call, so at least
that doesn't seem to be the performance overhead.
We get down to around 19.9us for _key_to_sha1 across 120 keys, which is
0.166us per key.

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
43
44
    TestSkipped,
44
45
    )
45
46
from bzrlib.trace import mutter
46
 
from bzrlib.transport import get_transport, remote
 
47
from bzrlib.transport import remote
47
48
 
48
49
 
49
50
class TestBzrServeBase(TestCaseWithTransport):
192
193
    def test_bzr_serve_port_readonly(self):
193
194
        """bzr server should provide a read only filesystem by default."""
194
195
        process, url = self.start_server_port()
195
 
        transport = get_transport(url)
196
 
        self.assertRaises(errors.TransportNotPossible, transport.mkdir, 'adir')
 
196
        t = transport.get_transport(url)
 
197
        self.assertRaises(errors.TransportNotPossible, t.mkdir, 'adir')
197
198
        self.assertServerFinishesCleanly(process)
198
199
 
199
200
    def test_bzr_serve_port_readwrite(self):