Rev 4818: Use urlutils.local_path_to_url to handle both windows and linux. in http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-win32-accepted

John Arbash Meinel john at arbash-meinel.com
Mon Nov 16 21:36:57 GMT 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.1.0b4-win32-accepted

------------------------------------------------------------
revno: 4818
revision-id: john at arbash-meinel.com-20091116213652-74njzf1y3hvp9ojb
parent: john at arbash-meinel.com-20091116205238-dxub89y5jt5foo6y
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1.0b4-win32-accepted
timestamp: Mon 2009-11-16 15:36:52 -0600
message:
  Use urlutils.local_path_to_url to handle both windows and linux.
-------------- next part --------------
=== modified file 'bzrlib/tests/blackbox/test_serve.py'
--- a/bzrlib/tests/blackbox/test_serve.py	2009-11-16 19:59:40 +0000
+++ b/bzrlib/tests/blackbox/test_serve.py	2009-11-16 21:36:52 +0000
@@ -30,6 +30,7 @@
     errors,
     osutils,
     revision as _mod_revision,
+    urlutils,
     )
 from bzrlib.branch import Branch
 from bzrlib.bzrdir import BzrDir
@@ -280,6 +281,7 @@
         """
         # URLs always include the trailing slash, and get_base_path returns it
         base_dir = osutils.abspath('/a/b/c') + '/'
+        base_url = urlutils.local_path_to_url(base_dir) + '/'
         # Define a fake 'protocol' to capture the transport that cmd_serve
         # passes to serve_bzr.
         def capture_transport(transport, host, port, inet):
@@ -289,14 +291,14 @@
         cmd.run(directory=base_dir, protocol=capture_transport)
         server_maker = BzrServerFactory()
         self.assertEqual(
-            'readonly+file:///%s' % base_dir, self.bzr_serve_transport.base)
+            'readonly+%s' % base_url, self.bzr_serve_transport.base)
         self.assertEqual(
             base_dir, server_maker.get_base_path(self.bzr_serve_transport))
         # Read-write
         cmd.run(directory=base_dir, protocol=capture_transport,
             allow_writes=True)
         server_maker = BzrServerFactory()
-        self.assertEqual('file:///%s' % base_dir, self.bzr_serve_transport.base)
+        self.assertEqual(base_url, self.bzr_serve_transport.base)
         self.assertEqual(base_dir,
             server_maker.get_base_path(self.bzr_serve_transport))
 



More information about the bazaar-commits mailing list