Rev 4805: 2.1.0b4-win32-valid-transport-base was accepted in http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-dev
John Arbash Meinel
john at arbash-meinel.com
Mon Nov 16 20:12:57 GMT 2009
At http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-dev
------------------------------------------------------------
revno: 4805 [merge]
revision-id: john at arbash-meinel.com-20091116201253-bdns2kd204ig5kbr
parent: john at arbash-meinel.com-20091116201155-13v35xwa5iej5z0b
parent: john at arbash-meinel.com-20091110045831-e82zndn8q2btsgdz
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1.0b4-dev
timestamp: Mon 2009-11-16 14:12:53 -0600
message:
2.1.0b4-win32-valid-transport-base was accepted
modified:
bzrlib/tests/test_directory_service.py test_directory_servi-20080305221044-vr2mkvlsk8jypa2y-2
-------------- next part --------------
=== modified file 'bzrlib/tests/test_directory_service.py'
--- a/bzrlib/tests/test_directory_service.py 2009-03-23 14:59:43 +0000
+++ b/bzrlib/tests/test_directory_service.py 2009-11-10 04:58:31 +0000
@@ -16,18 +16,23 @@
"""Test directory service implementation"""
-from bzrlib import errors
+from bzrlib import (
+ errors,
+ urlutils,
+ )
from bzrlib.directory_service import DirectoryServiceRegistry, directories
from bzrlib.tests import TestCase, TestCaseWithTransport
from bzrlib.transport import get_transport
-from bzrlib import urlutils
class FooService(object):
"""A directory service that maps the name to a FILE url"""
+ # eg 'file:///foo' on Linux, or 'file:///C:/foo' on Windows
+ base = urlutils.local_path_to_url('/foo')
+
def look_up(self, name, url):
- return 'file:///foo' + name
+ return self.base + name
class TestDirectoryLookup(TestCase):
@@ -43,14 +48,15 @@
self.assertEqual('bar', suffix)
def test_dereference(self):
- self.assertEqual('file:///foobar',
+ self.assertEqual(FooService.base + 'bar',
self.registry.dereference('foo:bar'))
self.assertEqual('baz:qux', self.registry.dereference('baz:qux'))
def test_get_transport(self):
directories.register('foo:', FooService, 'Map foo URLs to http urls')
self.addCleanup(lambda: directories.remove('foo:'))
- self.assertEqual('file:///foobar/', get_transport('foo:bar').base)
+ self.assertEqual(FooService.base + 'bar/',
+ get_transport('foo:bar').base)
class TestAliasDirectory(TestCaseWithTransport):
More information about the bazaar-commits
mailing list