~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_directory_service.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-11 04:02:41 UTC
  • mfrom: (5017.2.2 tariff)
  • Revision ID: pqm@pqm.ubuntu.com-20100211040241-w6n021dz0uus341n
(mbp) add import-tariff tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2008 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
 
19
19
from bzrlib import (
20
20
    errors,
21
 
    transport,
22
21
    urlutils,
23
22
    )
24
23
from bzrlib.directory_service import DirectoryServiceRegistry, directories
25
24
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 Unix, or 'file:///C:/foo' on Windows
 
31
    # eg 'file:///foo' on Linux, 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):
56
56
        directories.register('foo:', FooService, 'Map foo URLs to http urls')
57
57
        self.addCleanup(directories.remove, 'foo:')
58
58
        self.assertEqual(FooService.base + 'bar/',
59
 
                         transport.get_transport('foo:bar').base)
 
59
                         get_transport('foo:bar').base)
60
60
 
61
61
 
62
62
class TestAliasDirectory(TestCaseWithTransport):