Rev 5020: Move LocalURLServer to bzrlib.tests.test_server in file:///home/vila/src/bzr/cleanup/test-servers/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Tue Feb 9 17:08:38 GMT 2010
At file:///home/vila/src/bzr/cleanup/test-servers/
------------------------------------------------------------
revno: 5020
revision-id: v.ladeuil+lp at free.fr-20100209170838-f11kugp9yns8lt5t
parent: v.ladeuil+lp at free.fr-20100209170649-ae9ore5pp4durhdg
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: test-servers
timestamp: Tue 2010-02-09 18:08:38 +0100
message:
Move LocalURLServer to bzrlib.tests.test_server
-------------- next part --------------
=== modified file 'bzrlib/tests/test_server.py'
--- a/bzrlib/tests/test_server.py 2010-02-09 17:06:49 +0000
+++ b/bzrlib/tests/test_server.py 2010-02-09 17:08:38 +0000
@@ -53,6 +53,21 @@
raise NotImplementedError
+class LocalURLServer(Server):
+ """A pretend server for local transports, using file:// urls.
+
+ Of course no actual server is required to access the local filesystem, so
+ this just exists to tell the test code how to get to it.
+ """
+
+ def start_server(self):
+ pass
+
+ def get_url(self):
+ """See Transport.Server.get_url."""
+ return urlutils.local_path_to_url('')
+
+
class DecoratorServer(Server):
"""Server for the TransportDecorator for testing with.
@@ -70,7 +85,6 @@
self._made_server = False
self._server = server
else:
- from bzrlib.transport.local import LocalURLServer
self._made_server = True
self._server = LocalURLServer()
self._server.start_server()
=== modified file 'bzrlib/transport/local.py'
--- a/bzrlib/transport/local.py 2010-01-07 03:03:01 +0000
+++ b/bzrlib/transport/local.py 2010-02-09 17:08:38 +0000
@@ -39,14 +39,14 @@
from bzrlib.transport import LateReadError
""")
-from bzrlib.transport import Transport, Server
+from bzrlib import transport
_append_flags = os.O_CREAT | os.O_APPEND | os.O_WRONLY | osutils.O_BINARY
_put_non_atomic_flags = os.O_CREAT | os.O_TRUNC | os.O_WRONLY | osutils.O_BINARY
-class LocalTransport(Transport):
+class LocalTransport(transport.Transport):
"""This is the transport agent for local filesystem access."""
def __init__(self, base):
@@ -554,23 +554,7 @@
return EmulatedWin32LocalTransport(abspath)
-class LocalURLServer(Server):
- """A pretend server for local transports, using file:// urls.
-
- Of course no actual server is required to access the local filesystem, so
- this just exists to tell the test code how to get to it.
- """
-
- def start_server(self):
- pass
-
- def get_url(self):
- """See Transport.Server.get_url."""
- return urlutils.local_path_to_url('')
-
-
def get_test_permutations():
"""Return the permutations to be used in testing."""
- return [
- (LocalTransport, LocalURLServer),
- ]
+ from bzrlib.tests import test_server
+ return [(LocalTransport, test_server.LocalURLServer),]
More information about the bazaar-commits
mailing list