~bzr/ubuntu/lucid/bzr/beta-ppa

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_directory_service.py

  • Committer: Martin Pool
  • Date: 2010-08-18 04:26:39 UTC
  • mfrom: (129.1.8 packaging-karmic)
  • Revision ID: mbp@sourcefrog.net-20100818042639-mjoxtngyjwiu05fo
* PPA rebuild for lucid.
* PPA rebuild for karmic.
* PPA rebuild onto jaunty.
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from bzrlib import (
20
20
    errors,
 
21
    transport,
21
22
    urlutils,
22
23
    )
23
24
from bzrlib.directory_service import DirectoryServiceRegistry, directories
24
25
from bzrlib.tests import TestCase, TestCaseWithTransport
25
 
from bzrlib.transport import get_transport
26
26
 
27
27
 
28
28
class FooService(object):
29
29
    """A directory service that maps the name to a FILE url"""
30
30
 
31
 
    # eg 'file:///foo' on Linux, or 'file:///C:/foo' on Windows
 
31
    # eg 'file:///foo' on Unix, or 'file:///C:/foo' on Windows
32
32
    base = urlutils.local_path_to_url('/foo')
33
33
 
34
34
    def look_up(self, name, url):
54
54
 
55
55
    def test_get_transport(self):
56
56
        directories.register('foo:', FooService, 'Map foo URLs to http urls')
57
 
        self.addCleanup(lambda: directories.remove('foo:'))
 
57
        self.addCleanup(directories.remove, 'foo:')
58
58
        self.assertEqual(FooService.base + 'bar/',
59
 
                         get_transport('foo:bar').base)
 
59
                         transport.get_transport('foo:bar').base)
60
60
 
61
61
 
62
62
class TestAliasDirectory(TestCaseWithTransport):