Rev 5022: Move ReadonlyServer to bzrlib.tests.readonly in file:///home/vila/src/bzr/cleanup/test-servers/

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Feb 9 17:15:17 GMT 2010


At file:///home/vila/src/bzr/cleanup/test-servers/

------------------------------------------------------------
revno: 5022
revision-id: v.ladeuil+lp at free.fr-20100209171517-1wzz1nh3d3nhnkbu
parent: v.ladeuil+lp at free.fr-20100209171304-2ppoju422x02s7fm
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: test-servers
timestamp: Tue 2010-02-09 18:15:17 +0100
message:
  Move ReadonlyServer to bzrlib.tests.readonly
-------------- next part --------------
=== modified file 'bzrlib/tests/test_server.py'
--- a/bzrlib/tests/test_server.py	2010-02-09 17:13:04 +0000
+++ b/bzrlib/tests/test_server.py	2010-02-09 17:15:17 +0000
@@ -137,3 +137,11 @@
         return self.get_url_prefix() + self._server.get_url()
 
 
+class ReadonlyServer(DecoratorServer):
+    """Server for the ReadonlyTransportDecorator for testing with."""
+
+    def get_decorator_class(self):
+        from bzrlib.transport import readonly
+        return readonly.ReadonlyTransportDecorator
+
+

=== modified file 'bzrlib/transport/readonly.py'
--- a/bzrlib/transport/readonly.py	2009-03-24 01:53:42 +0000
+++ b/bzrlib/transport/readonly.py	2010-02-09 17:15:17 +0000
@@ -17,10 +17,10 @@
 """Implementation of Transport that adapts another transport to be readonly."""
 
 from bzrlib.errors import TransportNotPossible, NoSmartMedium
-from bzrlib.transport.decorator import TransportDecorator, DecoratorServer
-
-
-class ReadonlyTransportDecorator(TransportDecorator):
+from bzrlib.transport import decorator
+
+
+class ReadonlyTransportDecorator(decorator.TransportDecorator):
     """A decorator that can convert any transport to be readonly.
 
     This is requested via the 'readonly+' prefix to get_transport().
@@ -78,15 +78,7 @@
         raise NoSmartMedium(self)
 
 
-
-class ReadonlyServer(DecoratorServer):
-    """Server for the ReadonlyTransportDecorator for testing with."""
-
-    def get_decorator_class(self):
-        return ReadonlyTransportDecorator
-
-
 def get_test_permutations():
     """Return the permutations to be used in testing."""
-    return [(ReadonlyTransportDecorator, ReadonlyServer),
-            ]
+    from bzrlib.tests import test_server
+    return [(ReadonlyTransportDecorator, test_server.ReadonlyServer),]



More information about the bazaar-commits mailing list